CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php

Summary

Maintainability
F
3 days
Test Coverage

Function _shiftBoundaries has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    function _shiftBoundaries($lines, &$changed, $other_changed)
    {
        $i = 0;
        $j = 0;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 6 hrs 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 _diag has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
    {
        $flip = false;

        if ($xlim - $xoff > $ylim - $yoff) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 5 hrs 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 diff has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    function diff($from_lines, $to_lines)
    {
        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 5 hrs 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

Method diff has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function diff($from_lines, $to_lines)
    {
        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));

Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 3 hrs to fix

    File native.php has 277 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.10 2008/01/04 10:27:53 jan Exp $
     *
     * Class used internally by Text_Diff to actually compute the diffs. This
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 2 hrs to fix

      Method _diag has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
          {
              $flip = false;
      
              if ($xlim - $xoff > $ylim - $yoff) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 2 hrs to fix

        Method _shiftBoundaries has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _shiftBoundaries($lines, &$changed, $other_changed)
            {
                $i = 0;
                $j = 0;
        
        
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 2 hrs to fix

          Function _compareseq has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              function _compareseq ($xoff, $xlim, $yoff, $ylim)
              {
                  /* Slide down the bottom initial diagonal. */
                  while ($xoff < $xlim && $yoff < $ylim
                         && $this->xv[$xoff] == $this->yv[$yoff]) {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.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

          Method _compareseq has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _compareseq ($xoff, $xlim, $yoff, $ylim)
              {
                  /* Slide down the bottom initial diagonal. */
                  while ($xoff < $xlim && $yoff < $ylim
                         && $this->xv[$xoff] == $this->yv[$yoff]) {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 1 hr to fix

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

                function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 35 mins to fix

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

                  function _lcsPos($ypos)
                  {
                      $end = $this->lcs;
                      if ($end == 0 || $ypos > $this->seq[$end]) {
                          $this->seq[++$this->lcs] = $ypos;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.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

              There are no issues that match your filters.

              Category
              Status