Closed ghost closed 5 years ago
Are you using the same php version in CI and homestead?
yes i do
How are you running phpinsights? Could you share your command on both CI and local for when you run it.
When I started using php insights in Scrutinizer CI, the short bin path didn't worked, so I use the long version.
Scrutinizer CI
vendor/nunomaduro/phpinsights/bin/phpinsights analyse --ansi -v --no-interaction
homestead
php artisan insights
So what I can see from here is that the config/insights.php
file is not being passed to your CI command. Try doing
vendor/nunomaduro/phpinsights/bin/phpinsights analyse --ansi -v --no-interaction --config-path=config/insights.php
A better approach would be to change your CI to also use php artisan insights
.
I have now added phpinsights as a command to ScrutinizerCI. Actually, I would expect to get the same results in a CI tool and in my local development environment (Laravel Homestead), but that wasn't the case.
These phpinsights rules were active in ScrutinizerCI • [Code] Forbidden public property: • [Code] 1 unused private attributes: • [Code] No setter: • [Code] Element name minimal length: • [Code] Useless overriding method: • [Code] Unused parameter: • [Code] Useless parentheses: • [Code] Declare strict types: • [Code] Empty comment: • [Code] Todo: • [Code] Disallow mixed type hint: • [Code] Type hint declaration: • [Code] Useless constant type hint: • [Code] Static closure: • [Complexity] Having
classes
with more than 5 cyclomatic complexity is prohibited - Consider refactoring: • [Architecture] Normal classes are forbidden. Classes must be final or abstract: • [Architecture] Class trait and interface length: • [Architecture] Property per class limit: • [Architecture] Function length: • [Architecture] The use oftraits
is prohibited: • [Style] Object operator indent: • [Style] Line length: • [Style] Alphabetically sorted uses:These phpinsights rules were active in Laravel Homestead. • [Code] Forbidden public property: • [Code] 1 unused private attributes: • [Code] No setter: • [Code] Element name minimal length: • [Code] Useless overriding method: • [Code] Unused parameter: • [Code] Useless parentheses: • [Code] Empty comment: • [Code] Todo: • [Code] Useless constant type hint: • [Code] Static closure: • [Complexity] Having
classes
with more than 5 cyclomatic complexity is prohibited - Consider refactoring: • [Architecture] Class trait and interface length: • [Architecture] Property per class limit: • [Architecture] Function length: • [Style] Object operator indent: • [Style] Line length:Has anyone made similar or the same experiences?
I've also checked if the laravel config file and phpinsights are in its latest version and both things are checked.