macool/jquery-ecuador-id-validator

View on GitHub

Showing 123 of 123 total issues

Function reportSpecResults has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
  var results = spec.results();
  var status = results.passed() ? 'passed' : 'failed';
  if (results.skipped) {
    status = 'skipped';
Severity: Minor
Found in lib/jasmine-1.3.1/jasmine-html.js - About 1 hr to fix

    Function refresh has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.refresh = function() {
    
        if (isUndefined(this.resultsMenu)) {
          this.createResultsMenu();
        }
    Severity: Minor
    Found in lib/jasmine-1.3.1/jasmine-html.js - About 1 hr to fix

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

      jasmine.StyleFixtures.prototype.load = function() {
        this.cleanUp()
        this.createStyle_(this.read_.apply(this, arguments))
      }
      Severity: Major
      Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 1 hr to fix
      lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 120..123

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

      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.Fixtures.prototype.load = function() {
        this.cleanUp()
        this.createContainer_(this.read.apply(this, arguments))
      }
      Severity: Major
      Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 1 hr to fix
      lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 216..219

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

      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

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

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

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

                if (tercer_digito === 9) {
                  if (this.numero.substr(10, 3) !== "001") {
                    throw new Error("RUC de entidad privada debe terminar en 001");
                  }
                  this.valid = digito_verificador === verificador;
        Severity: Major
        Found in src/ruc_jquery_validator.js and 1 other location - About 1 hr to fix
        src/ruc_jquery_validator.js on lines 83..88

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

        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 (tercer_digito === 6) {
                  if (this.numero.substr(9, 4) !== "0001") {
                    throw new Error("RUC de empresa del sector público debe terminar en 0001");
                  }
                  this.valid = digito_verificador === verificador;
        Severity: Major
        Found in src/ruc_jquery_validator.js and 1 other location - About 1 hr to fix
        src/ruc_jquery_validator.js on lines 89..94

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

        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

        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 lib/jasmine-1.3.1/jasmine.js - About 1 hr to fix

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

                mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
          Severity: Major
          Found in lib/jasmine-1.3.1/jasmine.js and 1 other location - About 1 hr to fix
          lib/jasmine-1.3.1/jasmine.js on lines 1567..1567

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 55.

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

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

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

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

          Refactorings

          Further Reading

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

                mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
          Severity: Major
          Found in lib/jasmine-1.3.1/jasmine.js and 1 other location - About 1 hr to fix
          lib/jasmine-1.3.1/jasmine.js on lines 927..927

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 55.

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

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

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

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

          Refactorings

          Further Reading

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

            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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 55 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 1364..1369

          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 have been called.",
                "Expected spy " + this.actual.identity + " not to have been called."
              ];
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine.js and 1 other location - About 55 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 1391..1396

          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

          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 lib/jasmine-1.3.1/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

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

          jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
            var showPassed, showSkipped;
          
            this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
                this.createDom('div', { className: 'banner' },
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine-html.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

          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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 55 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 2148..2151

          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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 55 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 2153..2156

          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.setInterval = function(funcToCall, millis) {
              self.timeoutsMade++;
              self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
              return self.timeoutsMade;
            };
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine.js and 1 other location - About 50 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 1584..1588

          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.setTimeout = function(funcToCall, millis) {
              self.timeoutsMade++;
              self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
              return self.timeoutsMade;
            };
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine.js and 1 other location - About 50 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 1590..1594

          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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 50 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 2482..2485

          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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 50 mins to fix
          lib/jasmine-1.3.1/jasmine.js on lines 2487..2490

          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

          Severity
          Category
          Status
          Source
          Language