fetzi/phpspec-watcher

View on GitHub

Showing 2 of 2 total issues

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        OutputStyle $output,
        FileWatcher $fileWatcher,
        LoopInterface $loop,
        Stdio $stdio,
        int $checkInterval,
Severity: Major
Found in src/Watcher.php - About 1 hr to fix

    The method runTests uses an else expression. Else is never necessary and you can simplify the code to work without else.
    Open

            } else {
                $this->notifyError();
            }
    Severity: Minor
    Found in src/Watcher.php by phpmd

    Since: PHPMD 1.4.0

    An if expression with an else branch is never necessary. You can rewrite the conditions in a way that the else is not necessary and the code becomes simpler to read. To achieve this use early return statements. To achieve this you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example:

    class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

    Source: http://phpmd.org/rules/cleancode.txt

    Severity
    Category
    Status
    Source
    Language