elephantly/AmpConverterBundle

View on GitHub

Showing 164 of 164 total issues

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

    }

Function closing brace must go on the next line following the body; found 1 blank lines before brace
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

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

    }
Severity: Minor
Found in Converter/AmpConverter.php by phpcodesniffer

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

}

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 getDefaultValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultValue($attribute)
    {
        switch ($attribute) {
            case 'layout':
                return 'responsive';
Severity: Minor
Found in Converter/Social/AmpTwitterConverter.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

}

Expected 1 space after FUNCTION keyword; 0 found
Open

Filter::register('kahlan.coverage-exporter', function($chain) {
Severity: Minor
Found in kahlan-config.travis.php by phpcodesniffer

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

    }

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 null;
    Severity: Major
    Found in Converter/Social/AmpPinterestConverter.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