public function assess(string $filePath): int
    {
        $this->score = 0;

        $contents = $this->getFileContents($filePath);
        $this->hasAtLeastOneMethod($contents);
        $this->countTheIfStatements($contents);
        $this->countTheElseIfStatements($contents);
        $this->countTheWhileLoops($contents);
        $this->countTheForLoops($contents);
        $this->countTheCaseStatements($contents);
        $this->countTheTernaryOperators($contents);
        $this->countTheLogicalAnds($contents);
        $this->countTheLogicalOrs($contents);

        if ($this->score === 0) {
            $this->score = 1;
        }
        return $this->score;
    }
public function assess(string $filePath): int
    {
        $this->score = 0;

        $contents = $this->getFileContents($filePath);
        $this->hasAtLeastOneMethod($contents);
        $this->countTheIfStatements($contents);
        $this->countTheElseIfStatements($contents);
        $this->countTheWhileLoops($contents);
        $this->countTheForLoops($contents);
        $this->countTheCaseStatements($contents);
        $this->countTheTernaryOperators($contents);
        $this->countTheLogicalAnds($contents);
        $this->countTheLogicalOrs($contents);

        if ($this->score === 0) {
            $this->score = 1;
        }
        return $this->score;
    }
public function assess ( string $ filePath ) : int { $ this -> score = 0 ; $ contents = $ this -> getFileContents ( $ filePath ) ; $ this -> hasAtLeastOneMethod ( $ contents ) ; $ this -> countTheIfStatements ( $ contents ) ; $ this -> countTheElseIfStatements ( $ contents ) ; $ this -> countTheWhileLoops ( $ contents ) ; $ this -> countTheForLoops ( $ contents ) ; $ this -> countTheCaseStatements ( $ contents ) ; $ this -> countTheTernaryOperators ( $ contents ) ; $ this -> countTheLogicalAnds ( $ contents ) ; $ this -> countTheLogicalOrs ( $ contents ) ; if ( $ this -> score === 0 ) { $ this -> score = 1 ; } return $ this -> score ; }
Asses the files cyclomatic complexity.
@param  string $filePath Path and file name.
@return integer
Asses the files cyclomatic complexity .