Moogsoft/node-moog

View on GitHub

Showing 81 of 81 total issues

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

        if (SLD && SLD.is(v)) {
          replace = new RegExp(escapeRegEx(this.tld()) + "$");
          this._parts.hostname = this._parts.hostname.replace(replace, v);
        } else {
Severity: Major
Found in doc/scripts/URI.js and 1 other location - About 1 hr to fix
doc/scripts/URI.js on lines 916..919

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

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

      } else {
        replace = new RegExp(escapeRegEx(this.tld()) + "$");
        this._parts.hostname = this._parts.hostname.replace(replace, v);
      }
Severity: Major
Found in doc/scripts/URI.js and 1 other location - About 1 hr to fix
doc/scripts/URI.js on lines 908..911

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

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

  p.domain = function(v, build) {
    if (this._parts.urn) {
      return v === undefined ? '' : this;
    }
    if (typeof v === 'boolean') {
Severity: Minor
Found in doc/scripts/URI.js - About 1 hr to fix

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

        if (pos > -1) {
          // escaping?
          parts.query = string.substring(pos + 1) || null;
          string = string.substring(0, pos);
        }
    Severity: Major
    Found in doc/scripts/URI.js and 1 other location - About 1 hr to fix
    doc/scripts/URI.js on lines 240..244

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

    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 (pos > -1) {
          // escaping?
          parts.fragment = string.substring(pos + 1) || null;
          string = string.substring(0, pos);
        }
    Severity: Major
    Found in doc/scripts/URI.js and 1 other location - About 1 hr to fix
    doc/scripts/URI.js on lines 247..251

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

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

        function defaultNumberParser(context) {
            var current = context.reader.current(), 
                number, 
                line = context.reader.getLine(), 
                column = context.reader.getColumn(),
    Severity: Minor
    Found in doc/scripts/sunlight.js - About 1 hr to fix

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

                  read: function(count) {
                      var value = getCharacters(count),
                          newlineCount,
                          lastChar;
      
      
      Severity: Minor
      Found in doc/scripts/sunlight.js - About 1 hr to fix

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

            a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
        Severity: Major
        Found in doc/scripts/prettify/prettify.js and 1 other location - About 1 hr to fix
        doc/scripts/prettify/prettify.js on lines 235..235

        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

            a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
        Severity: Major
        Found in doc/scripts/prettify/prettify.js and 1 other location - About 1 hr to fix
        doc/scripts/prettify/prettify.js on lines 103..103

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

                registerLanguage: function(languageId, languageData) {
                    var tokenName,
                        embeddedLanguages,
                        languageName;
                    
        Severity: Minor
        Found in doc/scripts/sunlight.js - About 1 hr to fix

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

            p.absoluteTo = function(base) {
              var resolved = this.clone();
              var properties = ['protocol', 'username', 'password', 'hostname', 'port'];
              var basedir, i, p;
              if (this._parts.urn) {
          Severity: Minor
          Found in doc/scripts/URI.js - About 1 hr to fix

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

              p.filename = function(v, build) {
                if (this._parts.urn) {
                  return v === undefined ? '' : this;
                }
                if (v === undefined || v === true) {
            Severity: Minor
            Found in doc/scripts/URI.js - About 1 hr to fix

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

                  function createProceduralRule(startIndex, direction, tokenRequirements, caseInsensitive) {
                      tokenRequirements = tokenRequirements.slice(0);
                      return function(tokens) {
                          var tokenIndexStart = startIndex,
                              j,
              Severity: Minor
              Found in doc/scripts/sunlight.js - About 1 hr to fix

                Function matchWord has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function matchWord(context, wordMap, tokenName, doNotRead) {
                        var current = context.reader.current(),
                            i,
                            word,
                            peek,
                Severity: Minor
                Found in doc/scripts/sunlight.js - About 1 hr to fix

                  Function m has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function m() {
                        for (var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; p < h.length && l.now() < e; p++) {
                          var n = h[p],
                              k = n.className;
                          if (k.indexOf("prettyprint") >= 0) {
                  Severity: Minor
                  Found in doc/scripts/prettify/prettify.js - About 1 hr to fix

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

                      , keydown: function (e) {
                          var $this
                            , $items
                            , $active
                            , $parent
                    Severity: Minor
                    Found in doc/scripts/bootstrap-dropdown.js - About 1 hr to fix

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

                        function M(a) {
                          function m(a) {
                            switch (a.nodeType) {
                            case 1:
                              if (e.test(a.className)) break;
                      Severity: Minor
                      Found in doc/scripts/prettify/prettify.js - About 1 hr to fix

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

                                        if (token.name === closer.token && contains(closer.values, token.value)) {
                                            if (token.name === opener.token && contains(opener.values, token.value, caseInsensitive)) {
                                                //if the closer is the same as the opener that's okay
                                                success = true;
                                                break;
                        Severity: Minor
                        Found in doc/scripts/sunlight.js and 1 other location - About 55 mins to fix
                        doc/scripts/sunlight.js on lines 368..376

                        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

                                        if (token.name === opener.token && contains(opener.values, token.value, caseInsensitive)) {
                                            if (token.name === closer.token && contains(closer.values, token.value, caseInsensitive)) {
                                                //if the closer is the same as the opener that's okay
                                                success = true;
                                                break;
                        Severity: Minor
                        Found in doc/scripts/sunlight.js and 1 other location - About 55 mins to fix
                        doc/scripts/sunlight.js on lines 345..353

                        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

                        Avoid deeply nested control flow statements.
                        Open

                                    for (c = 0; c < t; ++c) if (i = m[c], o = f.match(i[1])) {
                                      b = i[0];
                                      break
                                    }
                        Severity: Major
                        Found in doc/scripts/prettify/prettify.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language