elephantly/AmpConverterBundle

View on GitHub

Showing 164 of 164 total issues

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

The closing brace for the class must go on the next line after the body
Open

}

The closing brace for the class must go on the next line after the body
Open

}

Blank line found at end of control structure
Open


Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Blank line found at start of control structure
Open

        foreach ($this->inputElement->childNodes as $tag) {

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

The closing brace for the class must go on the next line after the body
Open

}

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

    public function callback()
    {

        foreach ($this->inputElement->childNodes as $tag) {

Severity: Minor
Found in Converter/Media/AmpVideoConverter.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

The closing brace for the class must go on the next line after the body
Open

}

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

The closing brace for the class must go on the next line after the body
Open

}

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

There must be one blank line after the last USE statement; 2 found;
Open

use DOMXPath;

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

The closing brace for the class must go on the next line after the body
Open

}

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Avoid too many return statements within this method.
Open

                return $this->oembed['height'] ? $this->oembed['height'] : 400;
Severity: Major
Found in Converter/Social/AmpInstagramConverter.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return 315;
    Severity: Major
    Found in Converter/Media/AmpYoutubeIframeConverter.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return null;
      Severity: Major
      Found in Converter/Social/AmpFacebookSdkConverter.php - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language