Kolyunya/codeception-markup-validator

View on GitHub

Showing 3 of 3 total issues

Function filterMessages has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterMessages(array $messages)
    {
        $filteredMessages = array();

        foreach ($messages as $message) {
Severity: Minor
Found in sources/Lib/MarkupValidator/DefaultMessageFilter.php - About 1 hr 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 initializeType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function initializeType(array $data)
    {
        if (isset($data['type']) === false) {
            return;
        }
Severity: Minor
Found in sources/Lib/MarkupValidator/W3CMarkupValidatorMessage.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 ignoreError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function ignoreError($summary)
    {
        if (is_array($this->configuration[self::IGNORED_ERRORS_CONFIG_KEY]) === false) {
            throw new Exception(sprintf('Invalid «%s» config key.', self::IGNORED_ERRORS_CONFIG_KEY));
        }
Severity: Minor
Found in sources/Lib/MarkupValidator/DefaultMessageFilter.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