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

False positive #6

Open
skyzyx opened this issue Apr 25, 2018 · 1 comment
Open

False positive #6

skyzyx opened this issue Apr 25, 2018 · 1 comment
Assignees
Labels

Comments

@skyzyx
Copy link

skyzyx commented Apr 25, 2018

I ran:

php www/bin/phpca www/src/ --since-version=7.2 | tee reports/phpca-src.txt

I got the following response, which identified this class: Pool

Scanning www/src/ ...
[pthreads] Class "Pool" used in file www/src/path/to/file[84]

Used non-built-in extensions in your code:
- pthreads. Extension is available in pecl: pthreads.

However, this is a snippet of my actual code, which is clearly not from the pthreads extension.

use GuzzleHttp\Pool;

$pool = new Pool($client, $requests(), [
    'concurrency' => 10,
    'fulfilled'   => static function ($response, $index): void { … },
    'rejected'    => static function ($reason, $index): void { … },
]);

Here is the version information:

$ composer info wapmorgan/php-code-analyzer -d www
name     : wapmorgan/php-code-analyzer
descrip. : A program that finds usage of different non-built-in extensions in your php code.
keywords : code analysis, command-line utility
versions : * dev-master
type     : package
license  : BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) (OSI approved) https://spdx.org/licenses/BSD-3-Clause.html#licenseText
source   : [git] https://github.com/wapmorgan/PhpCodeAnalyzer.git b778f61ee24b9e97b92422d853a37a350bde69a5
dist     : [zip] https://api.github.com/repos/wapmorgan/PhpCodeAnalyzer/zipball/b778f61ee24b9e97b92422d853a37a350bde69a5 b778f61ee24b9e97b92422d853a37a350bde69a5
names    : wapmorgan/php-code-analyzer

autoload
psr-4
wapmorgan\PhpCodeAnalyzer\ => src/

requires
docopt/docopt ~1.0

Perhaps resolving the namespace aliases first could reduce the false positives?

@wapmorgan wapmorgan self-assigned this May 1, 2018
@wapmorgan
Copy link
Owner

Yes, but this require a lot of work and restructuring. I don't have time for this now.

@wapmorgan wapmorgan added the bug label Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants