bmitch/Codor

View on GitHub

Showing 5 of 5 total issues

Function couldBeNullCoalescing has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function couldBeNullCoalescing($tokens, $index): bool
    {
        $questionMarkFound = false;
        $semiColinFound = false;

Severity: Minor
Found in src/Codor/Sniffs/Syntax/NullCoalescingSniff.php - About 55 mins to fix

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

Function ensuingDelimiter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function ensuingDelimiter(string $string): bool
    {
        foreach ($this->keywords as $keyword) {
            if (! $this->contains($keyword, $string)) {
                continue;
Severity: Minor
Found in src/Codor/Sniffs/Files/FunctionNameContainsAndOrSniff.php - About 35 mins to fix

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

Function handleVisibilityToken has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handleVisibilityToken($tokens, $index)
    {
        $count = count($tokens);

        for ($i = $index + 1; $i < $count; $i++) {
Severity: Minor
Found in src/Codor/Sniffs/Classes/PropertyDeclarationSniff.php - About 35 mins to fix

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

Function process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        if (! isset($tokens[$stackPtr]['scope_closer'])) {
            return;
Severity: Minor
Found in src/Codor/Sniffs/Syntax/LinesAfterMethodSniff.php - About 35 mins to fix

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

Function process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens            = $phpcsFile->getTokens();
        $token             = $tokens[$stackPtr];
        $functionNameToken = $tokens[$stackPtr + 2];
Severity: Minor
Found in src/Codor/Sniffs/Classes/ConstructorLoopSniff.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language