macool/jquery-ecuador-id-validator

View on GitHub

Showing 123 of 123 total issues

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

var isCommonJS = typeof window == "undefined" && typeof exports == "object";

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

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

    jasmine.HtmlReporterHelpers = {};
    
    jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
      var el = document.createElement(type);
    
    
    Severity: Major
    Found in lib/jasmine-1.3.1/jasmine-html.js - About 1 day to fix

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

        for (var i = 0; i < resultItems.length; i++) {
          var result = resultItems[i];
      
          if (result.type == 'log') {
            messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
      Severity: Major
      Found in lib/jasmine-1.3.1/jasmine-html.js and 1 other location - About 1 day to fix
      lib/jasmine-1.3.1/jasmine-html.js on lines 633..645

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

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

        for (var i = 0; i < resultItems.length; i++) {
          var result = resultItems[i];
      
          if (result.type == 'log') {
            messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
      Severity: Major
      Found in lib/jasmine-1.3.1/jasmine-html.js and 1 other location - About 1 day to fix
      lib/jasmine-1.3.1/jasmine-html.js on lines 448..460

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

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

      jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
        var el = document.createElement(type);
      
        for (var i = 2; i < arguments.length; i++) {
          var child = arguments[i];
      Severity: Major
      Found in lib/jasmine-1.3.1/jasmine-html.js and 1 other location - About 7 hrs to fix
      lib/jasmine-1.3.1/jasmine-html.js on lines 498..520

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

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

      jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
        var el = document.createElement(type);
      
        for (var i = 2; i < arguments.length; i++) {
          var child = arguments[i];
      Severity: Major
      Found in lib/jasmine-1.3.1/jasmine-html.js and 1 other location - About 7 hrs to fix
      lib/jasmine-1.3.1/jasmine-html.js on lines 3..27

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

      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

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

      /*!
       Jasmine-jQuery: a set of jQuery helpers for Jasmine tests.
       
       Version 1.5.0
       
      Severity: Minor
      Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js - About 6 hrs 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 lib/jasmine-1.3.1/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 ReporterView has 119 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jasmine.HtmlReporter.ReporterView = function(dom) {
          this.startedAt = new Date();
          this.runningSpecCount = 0;
          this.completeSpecCount = 0;
          this.passedCount = 0;
        Severity: Major
        Found in lib/jasmine-1.3.1/jasmine-html.js - About 4 hrs to fix

          Function ReporterView has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

          jasmine.HtmlReporter.ReporterView = function(dom) {
            this.startedAt = new Date();
            this.runningSpecCount = 0;
            this.completeSpecCount = 0;
            this.passedCount = 0;
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine-html.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 HtmlReporter has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          jasmine.HtmlReporter = function(_doc) {
            var self = this;
            var doc = _doc || window.document;
          
            var reporterView;
          Severity: Minor
          Found in lib/jasmine-1.3.1/jasmine-html.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 HtmlReporter has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jasmine.HtmlReporter = function(_doc) {
            var self = this;
            var doc = _doc || window.document;
          
            var reporterView;
          Severity: Major
          Found in lib/jasmine-1.3.1/jasmine-html.js - About 4 hrs to fix

            Function next_ has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            jasmine.Queue.prototype.next_ = function() {
              var self = this;
              var goAgain = true;
            
              while (goAgain) {
            Severity: Minor
            Found in lib/jasmine-1.3.1/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

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

              this.addMatchers({
                toHaveBeenPrevented: function() {
                  var eventName = this.actual.eventName,
                      selector = this.actual.selector
                  this.message = function() {
            Severity: Major
            Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 4 hrs to fix
            lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 536..548

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

            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.addMatchers({
                toHaveBeenTriggered: function(){
                  var eventName = this.actual.eventName,
                      selector = this.actual.selector
                  this.message = function() {
            Severity: Major
            Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 4 hrs to fix
            lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 560..572

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

            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 validate has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  RucValidatorEc.prototype.validate = function() {
                    var digito_verificador, i, modulo, multiplicadores, p, producto, productos, provincias, residuo, suma, tercer_digito, verificador, _i, _j, _k, _l, _len, _len1, _ref, _ref1;
                    if ((_ref = this.numero.length) !== 10 && _ref !== 13) {
                      this.valid = false;
                      throw new Error("Longitud incorrecta.");
            Severity: Major
            Found in src/ruc_jquery_validator.js - About 3 hrs to fix

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

                this.addMatchers({
                  toHaveBeenPreventedOn: function(selector) {
                    this.message = function() {
                      return [
                        "Expected event " + this.actual + " to have been prevented on " + selector,
              Severity: Major
              Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 3 hrs to fix
              lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 525..535

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

              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.addMatchers({
                  toHaveBeenTriggeredOn: function(selector) {
                    this.message = function() {
                      return [
                        "Expected event " + this.actual + " to have been triggered on " + selector,
              Severity: Major
              Found in lib/jasmine-jquery-1.5.0/jasmine-jquery.js and 1 other location - About 3 hrs to fix
              lib/jasmine-jquery-1.5.0/jasmine-jquery.js on lines 549..559

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

              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().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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 3 hrs to fix
              lib/jasmine-1.3.1/jasmine.js on lines 1736..1742

              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 lib/jasmine-1.3.1/jasmine.js and 1 other location - About 3 hrs to fix
              lib/jasmine-1.3.1/jasmine.js on lines 1728..1734

              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

              Severity
              Category
              Status
              Source
              Language