catarse/catarse.js

View on GitHub
legacy/spec/lib/jasmine/jasmine.js

Summary

Maintainability
F
1 wk
Test Coverage

File jasmine.js has 1511 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
 *
 * @namespace
 */
Severity: Major
Found in legacy/spec/lib/jasmine/jasmine.js - About 4 days to fix

    Function matcherFn_ has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
      return function() {
        var matcherArgs = jasmine.util.argsToArray(arguments);
        var result = matcherFunction.apply(this, arguments);
    
    
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - 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 next_ has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.Queue.prototype.next_ = function() {
      var self = this;
      var goAgain = true;
    
      while (goAgain) {
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - About 4 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 format has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.PrettyPrinter.prototype.format = function(value) {
      if (this.ppNestLevel_ > 40) {
        throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
      }
    
    
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - About 2 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 compareObjects_ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
      if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
        return true;
      }
    
    
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - About 2 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 runFunctionsWithinRange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
      var scheduledFunc;
      var funcsToRun = [];
      for (var timeoutKey in this.scheduledFunctions) {
        scheduledFunc = this.scheduledFunctions[timeoutKey];
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - 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 equals_ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
      mismatchKeys = mismatchKeys || [];
      mismatchValues = mismatchValues || [];
    
      for (var i = 0; i < this.equalityTesters_.length; i++) {
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - 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 next_ has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jasmine.Queue.prototype.next_ = function() {
      var self = this;
      var goAgain = true;
    
      while (goAgain) {
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

      Function format has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jasmine.PrettyPrinter.prototype.format = function(value) {
        if (this.ppNestLevel_ > 40) {
          throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
        }
      
      
      Severity: Minor
      Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

        jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
          return function() {
            var matcherArgs = jasmine.util.argsToArray(arguments);
            var result = matcherFunction.apply(this, arguments);
        
        
        Severity: Minor
        Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

          Function toThrow has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          jasmine.Matchers.prototype.toThrow = function(expected) {
            var result = false;
            var exception;
            if (typeof this.actual != 'function') {
              throw new Error('Actual is not a function');
          Severity: Minor
          Found in legacy/spec/lib/jasmine/jasmine.js - 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 equals_ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
            mismatchKeys = mismatchKeys || [];
            mismatchValues = mismatchValues || [];
          
            for (var i = 0; i < this.equalityTesters_.length; i++) {
          Severity: Minor
          Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

            Function runFunctionsWithinRange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
              var scheduledFunc;
              var funcsToRun = [];
              for (var timeoutKey in this.scheduledFunctions) {
                scheduledFunc = this.scheduledFunctions[timeoutKey];
            Severity: Minor
            Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

              jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
                if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
                  return true;
                }
              
              
              Severity: Minor
              Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

                Function execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
                  this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
                  var latchFunctionResult;
                  try {
                    latchFunctionResult = this.latchFunction.apply(this.spec);
                Severity: Minor
                Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
                        return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
                      } else {
                        return "Expected function to throw an exception.";
                      }
                  Severity: Major
                  Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

                    Function addBeforesAndAftersToQueue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
                      var runner = this.env.currentRunner();
                      var i;
                    
                      for (var suite = this.suite; suite; suite = suite.parentSuite) {
                    Severity: Minor
                    Found in legacy/spec/lib/jasmine/jasmine.js - About 55 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

                    Avoid deeply nested control flow statements.
                    Open

                                if (i > 0) message += ",";
                    Severity: Major
                    Found in legacy/spec/lib/jasmine/jasmine.js - About 45 mins to fix

                      Function addResult has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jasmine.NestedResults.prototype.addResult = function(result) {
                        if (result.type != 'log') {
                          if (result.items_) {
                            this.rollupCounts(result);
                          } else {
                      Severity: Minor
                      Found in legacy/spec/lib/jasmine/jasmine.js - About 45 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 XmlHttpRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
                        try {
                          return new ActiveXObject("Msxml2.XMLHTTP.6.0");
                        } catch(e) {
                        }
                      Severity: Minor
                      Found in legacy/spec/lib/jasmine/jasmine.js - About 45 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 WaitsForBlock has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
                      Severity: Minor
                      Found in legacy/spec/lib/jasmine/jasmine.js - About 35 mins to fix

                        Function summarizeResult_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
                          var summaryMessages = [];
                          var messagesLength = result.messages.length;
                          for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
                            var resultMessage = result.messages[messageIndex];
                        Severity: Minor
                        Found in legacy/spec/lib/jasmine/jasmine.js - 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 formatException has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        jasmine.util.formatException = function(e) {
                          var lineNumber;
                          if (e.line) {
                            lineNumber = e.line;
                          }
                        Severity: Minor
                        Found in legacy/spec/lib/jasmine/jasmine.js - 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

                        Avoid too many return statements within this function.
                        Open

                            return (a == b);
                        Severity: Major
                        Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return (a == b);
                          Severity: Major
                          Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
                            Severity: Major
                            Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return a.matches(b);
                              Severity: Major
                              Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return (a === b);
                                Severity: Major
                                Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return a.getTime() == b.getTime();
                                  Severity: Major
                                  Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return b.matches(a);
                                    Severity: Major
                                    Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                        return other instanceof this.expectedClass;
                                      Severity: Major
                                      Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

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

                                        jasmine.MessageResult.prototype.toString = function() {
                                          var text = "";
                                          for(var i = 0; i < this.values.length; i++) {
                                            if (i > 0) text += " ";
                                            if (jasmine.isString_(this.values[i])) {
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js - 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

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

                                        jasmine.Env.prototype.contains_ = function(haystack, needle) {
                                          if (jasmine.isArray_(haystack)) {
                                            for (var i = 0; i < haystack.length; i++) {
                                              if (this.equals_(haystack[i], needle)) return true;
                                            }
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js - 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

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

                                        jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
                                          if (jasmine.Clock.installed.setTimeout.apply) {
                                            return jasmine.Clock.installed.setTimeout.apply(this, arguments);
                                          } else {
                                            return jasmine.Clock.installed.setTimeout(funcToCall, millis);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 3 hrs to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2391..2397

                                        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 95.

                                        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

                                        jasmine.getGlobal().setInterval = function(funcToCall, millis) {
                                          if (jasmine.Clock.installed.setInterval.apply) {
                                            return jasmine.Clock.installed.setInterval.apply(this, arguments);
                                          } else {
                                            return jasmine.Clock.installed.setInterval(funcToCall, millis);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 3 hrs to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2383..2389

                                        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 95.

                                        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

                                        jasmine.getGlobal().clearTimeout = function(timeoutKey) {
                                          if (jasmine.Clock.installed.clearTimeout.apply) {
                                            return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
                                          } else {
                                            return jasmine.Clock.installed.clearTimeout(timeoutKey);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 2 hrs to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2407..2413

                                        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 94.

                                        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

                                        jasmine.getGlobal().clearInterval = function(timeoutKey) {
                                          if (jasmine.Clock.installed.clearTimeout.apply) {
                                            return jasmine.Clock.installed.clearInterval.apply(this, arguments);
                                          } else {
                                            return jasmine.Clock.installed.clearInterval(timeoutKey);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 2 hrs to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2399..2405

                                        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 94.

                                        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 suite = this.suite; suite; suite = suite.parentSuite) {
                                            for (i = 0; i < suite.before_.length; i++) {
                                              this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
                                            }
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2038..2042

                                        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 70.

                                        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 (suite = this.suite; suite; suite = suite.parentSuite) {
                                            for (i = 0; i < suite.after_.length; i++) {
                                              this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
                                            }
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2027..2031

                                        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 70.

                                        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

                                        jasmine.Env.prototype.afterEach = function(afterEachFunction) {
                                          if (this.currentSuite) {
                                            this.currentSuite.afterEach(afterEachFunction);
                                          } else {
                                            this.currentRunner_.afterEach(afterEachFunction);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 774..780

                                        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 70.

                                        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

                                        jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
                                          if (this.currentSuite) {
                                            this.currentSuite.beforeEach(beforeEachFunction);
                                          } else {
                                            this.currentRunner_.beforeEach(beforeEachFunction);
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 786..793

                                        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 70.

                                        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

                                        jasmine.Spec.prototype.waits = function(timeout) {
                                          var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
                                          this.addToQueue(waitsFunc);
                                          return this;
                                        };
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1891..1895

                                        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 59.

                                        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

                                        jasmine.Spec.prototype.runs = function (func) {
                                          var block = new jasmine.Block(this.env, func, this);
                                          this.addToQueue(block);
                                          return this;
                                        };
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1924..1928

                                        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 59.

                                        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

                                          this.message = function() {
                                            return [
                                              "Expected spy " + this.actual.identity + " to have been called.",
                                              "Expected spy " + this.actual.identity + " not to have been called."
                                            ];
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 55 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1283..1288

                                        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 2 locations. Consider refactoring.
                                        Open

                                          this.message = function() {
                                            return [
                                              "Expected spy " + this.actual.identity + " to not have been called.",
                                              "Expected spy " + this.actual.identity + " to have been called."
                                            ];
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 55 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1256..1261

                                        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 2 locations. Consider refactoring.
                                        Open

                                        jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
                                          afterEachFunction.typeName = 'afterEach';
                                          this.after_.splice(0,0,afterEachFunction);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 55 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1791..1794

                                        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 53.

                                        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

                                        jasmine.isA_ = function(typeName, value) {
                                          return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 55 mins to fix
                                        legacy/spec/lib/jasmine-matchers.js on lines 82..84

                                        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 53.

                                        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

                                        jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
                                          beforeEachFunction.typeName = 'beforeEach';
                                          this.before_.splice(0,0,beforeEachFunction);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 55 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1796..1799

                                        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 53.

                                        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

                                          self.setTimeout = function(funcToCall, millis) {
                                            self.timeoutsMade++;
                                            self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
                                            return self.timeoutsMade;
                                          };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 50 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2245..2249

                                        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 52.

                                        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

                                          self.setInterval = function(funcToCall, millis) {
                                            self.timeoutsMade++;
                                            self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
                                            return self.timeoutsMade;
                                          };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 50 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2239..2243

                                        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 52.

                                        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

                                        jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
                                          afterEachFunction.typeName = 'afterEach';
                                          this.after_.unshift(afterEachFunction);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 50 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2124..2127

                                        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 51.

                                        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

                                        jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
                                          beforeEachFunction.typeName = 'beforeEach';
                                          this.before_.unshift(beforeEachFunction);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 50 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 2129..2132

                                        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 51.

                                        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

                                        jasmine.Matchers.prototype.toEqual = function(expected) {
                                          return this.env.equals_(this.actual, expected);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1347..1349

                                        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 49.

                                        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

                                        jasmine.Matchers.prototype.toContain = function(expected) {
                                          return this.env.contains_(this.actual, expected);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1175..1177

                                        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 49.

                                        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

                                        Identical blocks of code found in 4 locations. Consider refactoring.
                                        Open

                                          if (!jasmine.isSpy(this.actual)) {
                                            throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 3 other locations - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1252..1254
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1279..1281
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1301..1303

                                        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 48.

                                        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

                                        Identical blocks of code found in 4 locations. Consider refactoring.
                                        Open

                                          if (!jasmine.isSpy(this.actual)) {
                                            throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 3 other locations - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1279..1281
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1301..1303
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1328..1330

                                        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 48.

                                        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

                                        Identical blocks of code found in 4 locations. Consider refactoring.
                                        Open

                                          if (!jasmine.isSpy(this.actual)) {
                                            throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 3 other locations - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1252..1254
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1301..1303
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1328..1330

                                        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 48.

                                        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

                                        Identical blocks of code found in 4 locations. Consider refactoring.
                                        Open

                                          if (!jasmine.isSpy(this.actual)) {
                                            throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
                                          }
                                        Severity: Major
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 3 other locations - About 40 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1252..1254
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1279..1281
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1328..1330

                                        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 48.

                                        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 (property in a) {
                                            if (!hasKey(b, property) && hasKey(a, property)) {
                                              mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
                                            }
                                          }
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 35 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 834..838

                                        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 46.

                                        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

                                        jasmine.Matchers.prototype.toNotEqual = function(expected) {
                                          return !this.env.equals_(this.actual, expected);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 35 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1357..1359

                                        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 46.

                                        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

                                        jasmine.Matchers.prototype.toNotContain = function(expected) {
                                          return !this.env.contains_(this.actual, expected);
                                        };
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 35 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 1184..1186

                                        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 46.

                                        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 property in b) {
                                            if (!hasKey(a, property) && hasKey(b, property)) {
                                              mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
                                            }
                                          }
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 35 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 839..843

                                        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 46.

                                        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

                                          if (e.sourceURL) {
                                            file = e.sourceURL;
                                          }
                                          else if (e.fileName) {
                                            file = e.fileName;
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 30 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 614..619

                                        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 45.

                                        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

                                          if (e.line) {
                                            lineNumber = e.line;
                                          }
                                          else if (e.lineNumber) {
                                            lineNumber = e.lineNumber;
                                        Severity: Minor
                                        Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 30 mins to fix
                                        legacy/spec/lib/jasmine/jasmine.js on lines 623..628

                                        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 45.

                                        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