deps/v8/benchmarks/regexp.js

Summary

Maintainability
F
3 wks
Test Coverage

Function RegExpBenchmark has 1675 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function RegExpBenchmark() {
  var re0 = /^ba/;
  var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
  var re2 = /^\s*|\s*$/g;
  var re3 = /\bQBZPbageby_cynprubyqre\b/;
Severity: Major
Found in deps/v8/benchmarks/regexp.js - About 1 wk to fix

    File regexp.js has 1700 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2010 the V8 project authors. All rights reserved.
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions are
    // met:
    //
    Severity: Major
    Found in deps/v8/benchmarks/regexp.js - About 4 days to fix

      Function RegExpBenchmark has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
      Open

      function RegExpBenchmark() {
        var re0 = /^ba/;
        var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
        var re2 = /^\s*|\s*$/g;
        var re3 = /\bQBZPbageby_cynprubyqre\b/;
      Severity: Minor
      Found in deps/v8/benchmarks/regexp.js - About 2 days 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 runBlock11 has 419 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function runBlock11() {
          for (var i = 0; i < 2; i++) {
            ' .pybfr'.replace(re18, '');
            ' n.svryqOgaPnapry'.replace(re18, '');
            ' qg'.replace(re18, '');
      Severity: Major
      Found in deps/v8/benchmarks/regexp.js - About 2 days to fix

        Function runBlock9 has 153 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function runBlock9() {
            for (var i = 0; i < 5; i++) {
              s94[i].split(re32);
              s95[i].split(re32);
              'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
        Severity: Major
        Found in deps/v8/benchmarks/regexp.js - About 6 hrs to fix

          Function runBlock10 has 148 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function runBlock10() {
              for (var i = 0; i < 3; i++) {
                '%3Szxg=ra-HF'.replace(re39, '');
                '-8'.replace(re40, '');
                '-8'.replace(re10, '');
          Severity: Major
          Found in deps/v8/benchmarks/regexp.js - About 5 hrs to fix

            Function runBlock3 has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function runBlock3() {
                for (var i = 0; i < 27; i++) {
                  s67[i].replace(/[A-Za-z]/g, '');
                }
                for (var i = 0; i < 23; i++) {
            Severity: Major
            Found in deps/v8/benchmarks/regexp.js - About 4 hrs to fix

              Function runBlock6 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock6() {
                  for (var i = 0; i < 11; i++) {
                    s83[i].replace(/##yv0##/gi, '');
                    s83[i].replace(re57, '');
                    s84[i].replace(re58, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 3 hrs to fix

                Function runBlock8 has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function runBlock8() {
                    for (var i = 0; i < 7; i++) {
                      s21[i].match(/\d+/g);
                      'nsgre'.replace(re64, '');
                      'orsber'.replace(re64, '');
                Severity: Major
                Found in deps/v8/benchmarks/regexp.js - About 3 hrs to fix

                  Function runBlock0 has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function runBlock0() {
                      for (var i = 0; i < 6511; i++) {
                        re0.exec(s0[i]);
                      }
                      for (var i = 0; i < 1844; i++) {
                  Severity: Major
                  Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                    Function runBlock7 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function runBlock7() {
                        for (var i = 0; i < 9; i++) {
                          '0'.replace(re40, '');
                          '0'.replace(re10, '');
                          '0'.replace(re51, '');
                    Severity: Major
                    Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                      Function runBlock1 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function runBlock1() {
                          for (var i = 0; i < 81; i++) {
                            re8.exec(s26[i]);
                          }
                          for (var i = 0; i < 78; i++) {
                      Severity: Major
                      Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                        Function runBlock2 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function runBlock2() {
                            for (var i = 0; i < 40; i++) {
                              s57a[i].replace(re14, '');
                              s57a[i].replace(re15, '');
                            }
                        Severity: Major
                        Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                          Function runBlock4 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function runBlock4() {
                              for (var i = 0; i < 16; i++) {
                                ''.replace(/\*/g, '');
                                /\bnpgvir\b/.exec('npgvir');
                                /sversbk/i.exec(s15[i]);
                          Severity: Major
                          Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                            Function runBlock5 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function runBlock5() {
                                for (var i = 0; i < 13; i++) {
                                  'purpx'.replace(re14, '');
                                  'purpx'.replace(re15, '');
                                  'pvgl'.replace(re14, '');
                            Severity: Major
                            Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 40; i++) {
                                    s57a[i].replace(re14, '');
                                    s57a[i].replace(re15, '');
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 1 other location - About 1 hr to fix
                              deps/v8/benchmarks/regexp.js on lines 414..417

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 55.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 23; i++) {
                                    s68[i].replace(re27, '');
                                    s69[i].replace(re27, '');
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 1 other location - About 1 hr to fix
                              deps/v8/benchmarks/regexp.js on lines 317..320

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 55.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 5 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 93; i++) {
                                    s20[i].replace(re12, '');
                                    re13.exec(s20[i]);
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 4 other locations - About 55 mins to fix
                              deps/v8/benchmarks/regexp.js on lines 148..151
                              deps/v8/benchmarks/regexp.js on lines 263..266
                              deps/v8/benchmarks/regexp.js on lines 295..298
                              deps/v8/benchmarks/regexp.js on lines 429..432

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 54.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 5 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 170; i++) {
                                    s9[i].replace(re6, '');
                                    re7.exec(s10[i]);
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 4 other locations - About 55 mins to fix
                              deps/v8/benchmarks/regexp.js on lines 176..179
                              deps/v8/benchmarks/regexp.js on lines 263..266
                              deps/v8/benchmarks/regexp.js on lines 295..298
                              deps/v8/benchmarks/regexp.js on lines 429..432

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 54.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 5 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 44; i++) {
                                    s57[i].replace(re12, '');
                                    re13.exec(s57[i]);
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 4 other locations - About 55 mins to fix
                              deps/v8/benchmarks/regexp.js on lines 148..151
                              deps/v8/benchmarks/regexp.js on lines 176..179
                              deps/v8/benchmarks/regexp.js on lines 263..266
                              deps/v8/benchmarks/regexp.js on lines 429..432

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 54.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 5 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 77; i++) {
                                    s44[i].replace(re12, '');
                                    re13.exec(s44[i]);
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 4 other locations - About 55 mins to fix
                              deps/v8/benchmarks/regexp.js on lines 148..151
                              deps/v8/benchmarks/regexp.js on lines 176..179
                              deps/v8/benchmarks/regexp.js on lines 295..298
                              deps/v8/benchmarks/regexp.js on lines 429..432

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 54.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 5 locations. Consider refactoring.
                              Open

                                  for (var i = 0; i < 21; i++) {
                                    s70[i].replace(re12, '');
                                    re13.exec(s70[i]);
                                  }
                              Severity: Major
                              Found in deps/v8/benchmarks/regexp.js and 4 other locations - About 55 mins to fix
                              deps/v8/benchmarks/regexp.js on lines 148..151
                              deps/v8/benchmarks/regexp.js on lines 176..179
                              deps/v8/benchmarks/regexp.js on lines 263..266
                              deps/v8/benchmarks/regexp.js on lines 295..298

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 54.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status