hbmartin / graphviz2drawio

Convert graphviz (dot) files into draw.io / lucid (mxGraph) format
http://graphviz2drawio.rtfd.io
GNU General Public License v3.0
163 stars 33 forks source link

Fix shapes not being correctly propagated from SVG #57

Closed samkhal closed 5 days ago

samkhal commented 1 year ago

Previously shapes were not correctly propagated, and rectangle nodes would show up as ellipses (the default shape). Adds logic to set the shape when we parse the svg.

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.41%.

Quality metrics Before After Change
Complexity 4.48 ⭐ 4.21 ⭐ -0.27 👍
Method Length 55.31 ⭐ 57.12 ⭐ 1.81 👎
Working memory 7.44 🙂 7.33 🙂 -0.11 👍
Quality 72.79% 🙂 73.20% 🙂 0.41% 👍
Other metrics Before After Change
Lines 144 163 19
Changed files Quality Before Quality After Quality Change
graphviz2drawio/mx/Node.py 75.78% ⭐ 74.67% 🙂 -1.11% 👎
graphviz2drawio/mx/NodeFactory.py 58.96% 🙂 57.94% 🙂 -1.02% 👎
test/test_graphs.py 86.42% ⭐ 86.23% ⭐ -0.19% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
graphviz2drawio/mx/NodeFactory.py NodeFactory.from_svg 14 🙂 185 😞 11 😞 44.48% 😞 Try splitting into smaller methods. Extract out complex expressions
graphviz2drawio/mx/Node.py Node.__init__ 0 ⭐ 61 ⭐ 10 😞 74.75% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

hbmartin commented 5 days ago

Thank you!