phug-php/dev-tool

View on GitHub
src/Phug/DevTool/Application.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid assigning values to variables in if clauses and the like (line '96', column '15').
Open

    protected function getShellCommandPath($command)
    {
        $cwd = $this->getWorkingDirectory();
        $commandPath = $cwd."/$command";

Severity: Minor
Found in src/Phug/DevTool/Application.php by phpmd

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 '92', column '36').
Open

    protected function getShellCommandPath($command)
    {
        $cwd = $this->getWorkingDirectory();
        $commandPath = $cwd."/$command";

Severity: Minor
Found in src/Phug/DevTool/Application.php by phpmd

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

Call to method __construct from undeclared class \Symfony\Component\Console\Input\ArrayInput
Open

        return $command->run(new ArrayInput($arguments), $output);
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Class extends undeclared class \Symfony\Component\Console\Application (Did you mean class \Phug\DevTool\Application)
Open

class Application extends ConsoleApplication
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CoverageReportPrepareCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Parameter $output has undeclared type ?\Symfony\Component\Console\Output\OutputInterface
Open

    public function run(InputInterface $input = null, OutputInterface $output = null)
Severity: Minor
Found in src/Phug/DevTool/Application.php by phan

Reference to undeclared class \Symfony\Component\Console\Application (Did you mean class \Phug\DevTool\Application)
Open

        return parent::run($input, $output);
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CheckCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Reference to undeclared class \Symfony\Component\Console\Application (Did you mean class \Phug\DevTool\Application)
Open

        parent::__construct($name, $version);
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CodeStyleFixCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::find
Open

        $command = $this->find($command);
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CoverageCheckCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new InstallCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Parameter $output has undeclared type \Symfony\Component\Console\Output\OutputInterface
Open

    public function runCommand($command, OutputInterface $output, array $arguments = null)
Severity: Minor
Found in src/Phug/DevTool/Application.php by phan

Parameter $input has undeclared type ?\Symfony\Component\Console\Input\InputInterface
Open

    public function run(InputInterface $input = null, OutputInterface $output = null)
Severity: Minor
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CoverageReportCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new UnitTestsRunCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

Call to undeclared method \Phug\DevTool\Application::add
Open

        $this->add(new CodeStyleCheckCommand());
Severity: Critical
Found in src/Phug/DevTool/Application.php by phan

There are no issues that match your filters.

Category
Status