hpbuniat/copy-paste-detector

View on GitHub

Showing 12 of 22 total issues

Function collect has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Collector.prototype.collect = function(directory, depth, include, exclude) {
      var excludes, files, includes;
      files = wrench.readdirSyncRecursive(directory);
      if (!include) {
        include = "*";
Severity: Major
Found in lib/collector.js - About 2 hrs to fix

    Method complex has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function complex($v1, $v2)
        {
            $v3 = $v1 / ($v2 + $v1);
            if ($v3 > 14)
            {
    Severity: Minor
    Found in __fixtures__/php/Math.php - About 1 hr to fix

      Method div has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function div($v1, $v2)
          {
              $v3 = $v1 / ($v2 + $v1);
              if ($v3 > 14)
              {
      Severity: Minor
      Found in __fixtures__/php/Math.php - About 1 hr to fix

        Function div has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Math.prototype.div = function (v1, v2)
            {
                v3 = v1 / (v2 + v1);
                if (v3 > 14)
                {
        Severity: Minor
        Found in __fixtures__/js/Math.js - About 1 hr to fix

          Function complex has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Math.prototype.complex = function (v1, v2)
              {
                  v3 = v1 / (v2 + v1);
                  if (v3 > 14)
                  {
          Severity: Minor
          Found in __fixtures__/js/Math.js - About 1 hr to fix

            Function analyze has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Parser.prototype.analyze = function(result, file, stack, tokens, lines) {
                  var f, firstHash, firstLine, firstToken, hash, i, sig, tokenPos;
                  sig = '';
                  tokenPos = [];
                  _.forEach(stack, function(token, i) {
            Severity: Minor
            Found in lib/parser.js - About 1 hr to fix

              Function recursiveRuleParser has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ParseCSS.prototype.recursiveRuleParser = function(rules, scope, fuzzy) {
                    _.forEach(rules, (function(_this) {
                      return function(rule) {
                        if (rule.rules != null) {
                          return _this.recursiveRuleParser(rule.rules, rule.type + " ", fuzzy);
              Severity: Minor
              Found in lib/parser/css.js - About 1 hr to fix

                Function addClone has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    Parser.prototype.addClone = function(result, file, tokenPos, lines, tokens, i, firstToken, firstLine, firstHash) {
                Severity: Major
                Found in lib/parser.js - About 1 hr to fix

                  Function complex has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function complex($v1, $v2)
                      {
                          $v3 = $v1 / ($v2 + $v1);
                          if ($v3 > 14)
                          {
                  Severity: Minor
                  Found in __fixtures__/php/Math.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 div has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function div($v1, $v2)
                      {
                          $v3 = $v1 / ($v2 + $v1);
                          if ($v3 > 14)
                          {
                  Severity: Minor
                  Found in __fixtures__/php/Math.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 analyze has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      Parser.prototype.analyze = function(result, file, stack, tokens, lines) {
                  Severity: Minor
                  Found in lib/parser.js - About 35 mins to fix

                    Function parse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        Parser.prototype.parse = function(result, file, tokens, lines, fuzzy) {
                    Severity: Minor
                    Found in lib/parser.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language