Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant inheritance lines in inheritance-graph printer #157

Closed
tinchoabbate opened this issue Feb 1, 2019 · 1 comment
Closed

Redundant inheritance lines in inheritance-graph printer #157

tinchoabbate opened this issue Feb 1, 2019 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@tinchoabbate
Copy link

Hey guys! I've been using Slither for some time now and found it quite useful, so thanks for all the effort you put into developing this tool.

While using the inheritance-graph printer, I found that the resulting graph contains several redundant inheritance lines that should be better left off the graph. For instance:

pragma solidity ^0.4.25;
contract Grandparent { }
contract Parent is Grandparent {}
contract Child is Parent {}

Slither's printer output is:
inheritance

Note that there's a line that goes from Child to Grandparent which is redundant, as Child is already Parent and Parent is already Grandparent. While this example is pretty simple, in far more complex inheritance chains these extra lines add little to no value and the graph ends up being too cluttered with lines pointing everywhere.

I'm not sure if this is a feature you added on purpose or a bug. If the former, are you considering adding an extra flag to the printer so those extra lines are not included in the final inheritance graph?.

@montyly
Copy link
Member

montyly commented Feb 2, 2019

Thank you @tinchoabbate for pointing out this limitation!

We can, indeed, print the inheritance without these additional lines. We can either replace the original printer or create a second one.

I don't have a strong opinion, I will discuss it internally and see what makes the more sense.

@montyly montyly added the enhancement New feature or request label Feb 2, 2019
@montyly montyly added this to the 0.6.0 milestone Feb 2, 2019
@montyly montyly closed this as completed in 331868d Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants