Method configure
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this->setName('check')
->addOption(
'report',
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
Method runCoverage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
{
$app = $this->getApplication();
$phpVersion = $input->getOption('coverage-php-version');
Function execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid assigning values to variables in if clauses and the like (line '91', column '14'). Open
protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
{
$app = $this->getApplication();
$phpVersion = $input->getOption('coverage-php-version');
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '124', column '17'). Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '129', column '14'). Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '133', column '33'). Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '97', column '14'). Open
protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
{
$app = $this->getApplication();
$phpVersion = $input->getOption('coverage-php-version');
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '137', column '60'). Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$app = $this->getApplication();
$coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Reference to constant VALUE_OPTIONAL
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_OPTIONAL,
- Exclude checks
Argument #1 of this call to \preg_match
is typically a literal or constant but isn't, but argument #2 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order. Open
if (!preg_match('/^'.preg_quote($phpVersion).'(\D.*)?$/', PHP_VERSION)) {
- Exclude checks
Reference to constant VALUE_OPTIONAL
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_OPTIONAL,
- Exclude checks
Reference to constant VALUE_NONE
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_NONE,
- Exclude checks
Parameter $input
has undeclared type \Symfony\Component\Console\Input\InputInterface
Open
protected function execute(InputInterface $input, OutputInterface $output)
- Exclude checks
Parameter $input
has undeclared type \Symfony\Component\Console\Input\InputInterface
Open
protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
- Exclude checks
Call to method writeln
from undeclared class \Symfony\Component\Console\Output\OutputInterface
Open
$output->writeln(
- Exclude checks
Reference to constant VALUE_OPTIONAL
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_OPTIONAL,
- Exclude checks
Call to method writeln
from undeclared class \Symfony\Component\Console\Output\OutputInterface
Open
$output->writeln(
- Exclude checks
Call to undeclared method \Phug\DevTool\Command\CheckCommand::setName
Open
$this->setName('check')
- Exclude checks
Parameter $output
has undeclared type \Symfony\Component\Console\Output\OutputInterface
Open
protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
- Exclude checks
Call to method getOption
from undeclared class \Symfony\Component\Console\Input\InputInterface
Open
'--ignore-tests' => $input->getOption('ignore-tests'),
- Exclude checks
Reference to constant VALUE_NONE
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_NONE,
- Exclude checks
Call to method getOption
from undeclared class \Symfony\Component\Console\Input\InputInterface
Open
if ($value = $input->getOption($option)) {
- Exclude checks
Call to method getOption
from undeclared class \Symfony\Component\Console\Input\InputInterface
Open
$phpVersion = $input->getOption('coverage-php-version');
- Exclude checks
Reference to constant VALUE_NONE
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_NONE,
- Exclude checks
Reference to constant VALUE_OPTIONAL
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_OPTIONAL,
- Exclude checks
Reference to constant VALUE_NONE
from undeclared class \Symfony\Component\Console\Input\InputOption
Open
InputOption::VALUE_NONE,
- Exclude checks
Parameter $output
has undeclared type \Symfony\Component\Console\Output\OutputInterface
Open
protected function execute(InputInterface $input, OutputInterface $output)
- Exclude checks