-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Does scanning of PHP composer work properly? #776
Comments
* add PHPComposer to PACKAGE_TYPES * Fix PHPComposer settings (use real tuples in class-level attributes) * misc cosmetics changes (unused imports, blank lines) * add new reconize tests for composer and npm * add CLI-level test for composer.json Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@scandinaf710 good catch. The package parser is there but somehow not active. I pushed a branch and PR to fix this |
@scandinaf710 A fix is waiting for you in the lucky #777 PR ! |
@pombredanne Well, I downloaded tarball and ran this version of scancode asking to analyze just one single file composer.json with the following "require" section:
What I expect is that scancode will show the list of licenses for each module. But it gives me the following:
Maybe, I run scancode somehow incorrectly? |
@scandinaf710 Thanks for testing .... There may be still something that needs to be fixed as there should be a proper "package" item returned when you scan your composer.json file and it looks like this is not the case... Also here are a couple things for you to consider/understand: ScanCode collects the information about the files in your local codebase... it never goes out and fetch extra things from the web: it will never query a remote package manager and collect information NOT in the codebase. For instance for this composer.json you get this JSON result with a proper package item and data that are normalized (e.g. a Maven pom.xml or an NPM package.json end up normalized in the same data structure). The dependencies are listed but not fetched. They would be scanned ONLY if they are in your codebase. Therefore fetching (and resolving dependencies) remotely is something that is needs to be done ahead of scanning your code. In the future this other tool is also meant to do this https://github.com/nexB/dependentcode/ and you can see some of the related discussions there: aboutcode-org/dependency-inspector#1 (and help is welcomed and needed to make it happen!) I hope this clears things out. |
@pombredanne thank you for your explanation. Please, find attached composer file. |
* add PHPComposer to PACKAGE_TYPES * Fix PHPComposer settings (use real tuples in class-level attributes) * misc cosmetics changes (unused imports, blank lines) * add new reconize tests for composer and npm * add CLI-level test for composer.json Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* these are valid, but non-publishable packages #776 * also refine tests and parsing * improve handling of licenses per composer schema docs * allow top create a package from data rather than location Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@scandinaf710 I was able to track the issue thanks to your test file and this has been merged in develop. |
I am doing some cleanup and review as a prep for the 3.0 release... and since this is fixed in develop, I am closing this! |
Hi all,
I am using scancode 2.1.0 and according to the release notes scanning PHP composer is already there. However, even though scancode finds composer.json, I don't see any analysis of dependencies section even when I put only this file as input.
How to run this package check correctly?
The text was updated successfully, but these errors were encountered: