Skip to content

Commit

Permalink
update rule graph creation for java
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ckl0sk0rtge committed Jun 10, 2024
1 parent 726db36 commit 60adee4
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 3,863 deletions.
4 changes: 0 additions & 4 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Check for coding style
mvn checkstyle::check
```

## Development

> To visulize the detection rules visit the github page https://pages.github.com/IBM/sonar-cryptography
## Build

### Build the Plugin
Expand Down
6 changes: 3 additions & 3 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
<version>3.3.0</version>
<executions>
<execution>
<phase>test</phase>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${basedir}/../rule-graph/run.sh</executable>
<workingDirectory>${basedir}/../rule-graph</workingDirectory>
<executable>${basedir}/rule-graph/build-graph.sh</executable>
<workingDirectory>${basedir}/rule-graph</workingDirectory>
</configuration>
</plugin>
</plugins>
Expand Down
File renamed without changes.
9 changes: 2 additions & 7 deletions rule-graph/parse.py → java/rule-graph/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# CONSTANTS

cwd = os.getcwd()
json_file_path = cwd + "/../java/target/rules.json"
json_file_path = cwd + "/../target/rules.json"
graph_file_name = "./java_graph.html"
graph_height = "960px"
# Can add buttons to play with the following things: ['nodes', 'edges', 'physics']
Expand Down Expand Up @@ -154,14 +154,9 @@ def get_node_details(nid, is_an_entry_point):
net.show_buttons(filter_=graph_buttons)
net.save_graph(graph_file_name)

pagesPath = cwd + "/../docs"
indexFile = pagesPath + "/index.html"
libDir = pagesPath + "/lib"

indexFile = "./index.html"
if os.path.exists(indexFile):
os.remove(indexFile)
if os.path.exists(libDir):
shutil.rmtree(libDir)

shutil.move(graph_file_name, indexFile)
shutil.move("./lib", libDir)
File renamed without changes.
Loading

0 comments on commit 60adee4

Please sign in to comment.