-
Notifications
You must be signed in to change notification settings - Fork 363
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
The dependency analyzer extends projects scope by pulling the dependencies into it #405
Comments
…cts scope by pulling the dependencies into it)
@Typz: Can you have a look, please? I've tried a fix but earned a NullPointerException. See the branch 'dependency_analyzer_bug'. It also includes a behave test which triggers the bug. |
I will try to check this before the weekend.
|
Issue is in DsmSerializer.serializeCell(), where "dependencyIndex.get(cell.getEdge())" can now return null (and thus get us a NullPointerException). It is easy to fix there, and it makes the test pass; however I am not sure this is sufficient: we may still end up importing the file somehow (since they will get in the serialized DSM: just now without the dependency). A complete fix would be to "simply" filter the whole packages and files graphs at the beginning of save(), to ensure we don't introduce the extra files in any place [neither in saved deps, feedback cycles, or DSM]... Filtering in addFile() would be much simpler (e.g. one test in line 108), but I am not sure the included files have been indexed yet... I'll keep looking... |
Thanks for poking. FYI: dependency analysis runs as part of the Squid sensor, which is after indexing files. |
Well that's cool, should allow for a nice and clean fix. I'll try that.
|
Do not include external files in package/file graphs, this causes the dependency analyzer to extend projects scope by pulling the dependencies into it.
Updated the branch 'dependency_analyzer_bug' with a working patch. |
Cool, thanks. Extra warning: will have a look. |
@Typz Could you provide a solution by 2015-04-19 for this? If not we remove it from 0.9.3. |
The branch was merged by @wenns some times ago, it should be fine I believe. |
The bug can be observed when analysing "test/resources/org/sonar/plugins/cxx/include-directories-project". "sonar.sources" is set to "src". Nevertheless, the dependency analyser pulls "include" and "include_snd" into SQ, resulting in files=10 (should be: 1). Ouch...
The text was updated successfully, but these errors were encountered: