Moogsoft/node-moog

View on GitHub

Showing 81 of 81 total issues

File URI.js has 1284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * URI.js - Mutating URLs
 *
 * Version: 1.8.3
 *
Severity: Major
Found in doc/scripts/URI.js - About 3 days to fix

    File sunlight.js has 884 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Sunlight
     *    Intelligent syntax highlighting
     *
     * http://sunlightjs.com/
    Severity: Major
    Found in doc/scripts/sunlight.js - About 2 days to fix

      Function prototype has 420 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Highlighter.prototype = (function() {
              var parseNextToken = (function() {
                  function isIdentMatch(context) {
                      return context.language.identFirstLetter && context.language.identFirstLetter.test(context.reader.current());
                  }
      Severity: Major
      Found in doc/scripts/sunlight.js - About 2 days to fix

        File prettify.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var q = null;
        window.PR_SHOULD_USE_CONTINUATION = !0;
        (function() {
          function L(a) {
            function m(a) {
        Severity: Minor
        Found in doc/scripts/prettify/prettify.js - About 7 hrs to fix

          Function moogREST has 167 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.moogREST = function moogREST(options) {
              'use strict';
              if ((this instanceof moogREST)) {
                  util.log("ERROR Don't use new for moogREST");
                  return;
          Severity: Major
          Found in lib/node-moog.js - About 6 hrs to fix

            Function moogREST has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.moogREST = function moogREST(options) {
                'use strict';
                if ((this instanceof moogREST)) {
                    util.log("ERROR Don't use new for moogREST");
                    return;
            Severity: Minor
            Found in lib/node-moog.js - About 5 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 parseNextToken has 113 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var parseNextToken = (function() {
                        function isIdentMatch(context) {
                            return context.language.identFirstLetter && context.language.identFirstLetter.test(context.reader.current());
                        }
            
            
            Severity: Major
            Found in doc/scripts/sunlight.js - About 4 hrs to fix

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

                p.host = function(v, build) {
                  if (this._parts.urn) {
                    return v === undefined ? '' : this;
                  }
                  if (v === undefined) {
              Severity: Major
              Found in doc/scripts/URI.js and 1 other location - About 4 hrs to fix
              doc/scripts/URI.js on lines 776..787

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

              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

                p.authority = function(v, build) {
                  if (this._parts.urn) {
                    return v === undefined ? '' : this;
                  }
                  if (v === undefined) {
              Severity: Major
              Found in doc/scripts/URI.js and 1 other location - About 4 hrs to fix
              doc/scripts/URI.js on lines 764..775

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

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

                  function createCodeReader(text) {
                      var index = 0,
                          line = 1,
                          column = 1,
                          length,
              Severity: Major
              Found in doc/scripts/sunlight.js - About 3 hrs to fix

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

                  p.unicode = function() {
                    // expect iso8859 input, unicode output
                    var e = URI.encode;
                    var d = URI.decode;
                    URI.encode = strictEncodeURIComponent;
                Severity: Major
                Found in doc/scripts/URI.js and 1 other location - About 3 hrs to fix
                doc/scripts/URI.js on lines 1220..1230

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

                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

                  p.iso8859 = function() {
                    // expect unicode input, iso8859 output
                    var e = URI.encode;
                    var d = URI.decode;
                    URI.encode = escape;
                Severity: Major
                Found in doc/scripts/URI.js and 1 other location - About 3 hrs to fix
                doc/scripts/URI.js on lines 1231..1241

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

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

                  function L(a) {
                    function m(a) {
                      var f = a.charCodeAt(0);
                      if (f !== 92) return f;
                      var b = a.charAt(1);
                Severity: Major
                Found in doc/scripts/prettify/prettify.js - About 2 hrs to fix

                  Function sendEvent has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      self.sendEvent = function (mEvent, callback) {
                          // Parse the data we're going to add.
                          var myEvent = mEvent;
                          var epochDate = Math.round(Date.now() / 1000);
                          var num = myEvent.external_id++ || 0;
                  Severity: Major
                  Found in lib/node-moog.js - About 2 hrs to fix

                    Function toc has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    $.fn.toc = function(options) {
                      var self = this;
                      var opts = $.extend({}, jQuery.fn.toc.defaults, options);
                    
                      var container = $(opts.container);
                    Severity: Major
                    Found in doc/scripts/toc.js - About 2 hrs to fix

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

                                  isAlreadyHighlighted: function() {
                                      var regex;
                                      return function(node) {
                                          if (!regex) {
                                              regex = new RegExp("(?:\\s|^)" + this.options.classPrefix + "highlighted(?:\\s|$)");
                      Severity: Major
                      Found in doc/scripts/sunlight.js and 1 other location - About 2 hrs to fix
                      doc/scripts/sunlight.js on lines 966..976

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

                      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

                                  matchSunlightNode: function() {
                                      var regex;
                                      
                                      return function(node) {
                                          if (!regex) {
                      Severity: Major
                      Found in doc/scripts/sunlight.js and 1 other location - About 2 hrs to fix
                      doc/scripts/sunlight.js on lines 979..988

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

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

                              function tokenize(unhighlightedCode, language, partialContext, options) {
                                  var tokens = [],
                                      context,
                                      continuation,
                                      token;
                      Severity: Major
                      Found in doc/scripts/sunlight.js - About 2 hrs to fix

                        Function equals has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          p.equals = function(uri) {
                            var one = this.clone();
                            var two = new URI(uri);
                            var one_map = {};
                            var two_map = {};
                        Severity: Major
                        Found in doc/scripts/URI.js - About 2 hrs to fix

                          Function E has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function E(a) {
                              var m =
                              a.g;
                              try {
                                var e = M(a.h),
                          Severity: Major
                          Found in doc/scripts/prettify/prettify.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language