Created
November 4, 2019 17:11
-
-
Save vprusa/0fa647248de55a12d88d8028fb0d12a0 to your computer and use it in GitHub Desktop.
pv021 callgraph on existing project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# using https://github.com/gousiosg/java-callgraph | |
# basic static on https://github.com/university-studies/neural-networks-pv021 | |
java -jar ./target/javacg-0.1-SNAPSHOT-static.jar ./neural-networks-forecast-1.0-SNAPSHOT.jar > callgraph.txt | |
sed -i '/CliArgumentsParser/d' ./callgraph.txt | |
sed -i '/TestUtils/d' ./callgraph.txt | |
sed -i '/OHLC/d' ./callgraph.txt | |
sed -i 's/cz.muni.neural.network.//g' ./callgraph.txt | |
#sed -i '/double/d' ./callgraph.txt | |
#sed -i '/int/d' ./callgraph.txt | |
#sed -i '/List/d' ./callgraph.txt | |
#sed -i '/Object/d' ./callgraph.txt | |
sed -i '/java/d' ./callgraph.txt | |
sort ./callgraph.txt | uniq -d > ./callgraph2.txt | |
mv callgraph2.txt callgraph.txt | |
OUT=callgraph.dot | |
echo "graph test {" > $OUT | |
sed -e 's/[a-z]+\.//g;' -e 's/ / -- /;' -e 's/[\$|\:]/_/g' -e 's/\.//g' -e 's/(//g' -e 's/)//g' -e 's/\[//g' -e 's/\]//g' -e 's/[0-9]*//g' callgraph.txt >> $OUT | |
echo "}" >> $OUT | |
dot -Tpng callgraph.dot -o callgraph.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment