bkdotcom/CssXpath

View on GitHub

Showing 5 of 5 total issues

Method regexs has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function regexs()
    {
        /*
            The order in which items are replaced is IMPORTANT!
        */
Severity: Major
Found in src/CssXpath.php - About 3 hrs to fix

    Method assertSelectEquals has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = true)
    Severity: Minor
    Found in src/DOMAssertionTrait.php - About 45 mins to fix

      Method assertSelectRegExp has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = true)
      Severity: Minor
      Found in src/DOMAssertionTrait.php - About 45 mins to fix

        Method assertSelectCount has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = true)
        Severity: Minor
        Found in src/DOMAssertionTrait.php - About 35 mins to fix

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

              protected static function getDomXpath($html)
              {
                  if ($html instanceof DOMDocument) {
                      return new DOMXpath($html);
                  }
          Severity: Minor
          Found in src/CssSelect.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