glato / emerge

Emerge is a browser-based interactive codebase and dependency visualization tool for many different programming languages. It supports some basic code quality and graph metrics and provides a simple and intuitive way to explore and analyze a codebase by using graph structures.
MIT License
783 stars 46 forks source link

Java classes defined in another class could not be recognized properly #23

Open HickeyHsu opened 2 years ago

HickeyHsu commented 2 years ago

For example:

import ast.Visitor;

public class Normalizer {
    visitors = new ArrayList<>();
    visitors.add(new VisitorA ());
    public class VisitorA extends Visitor{
    }
}

In this case, VisitorA will not generate a link with Normalizer; At the same time, imported ast.Visitor identified as node<ast.Visitor>in dependency_graph, and identified as node <visitor> in inheritance_graph. This causes the repeatedly appearing node to in complete_graph.

I haven`t tested in other language.

HickeyHsu commented 2 years ago

Another problem: for import like :

import org.antlr.v4.runtime.*;

Tools fails to build proper nodes and edges

HickeyHsu commented 2 years ago

For example:

import ast.Visitor;

public class Normalizer {
    visitors = new ArrayList<>();
    visitors.add(new VisitorA ());
    public class VisitorA extends Visitor{
    }
}

In this case, VisitorA will not generate a link with Normalizer; At the same time, imported ast.Visitor identified as node<ast.Visitor>in dependency_graph, and identified as node <visitor> in inheritance_graph. This causes the repeatedly appearing node to in complete_graph.

I haven`t tested in other language.

I made some rough changes to the code to make the improvements mentioned above. view at https://github.com/HickeyHsu/SoftwareNetGen

glato commented 2 years ago

@HickeyHsu Thanks for the feedback. I'll have a closer look at the issues and try to give you feedback in the following days. Probably this is the case, since the parsers can't really handle nested structures (yet) to extract them in a recursive way. I'll have a look at your modifications, looking forward 👋.