Moogsoft/node-moog

View on GitHub

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

              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

                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

                      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

                            Function highlightRecursive has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        highlightNode: function highlightRecursive(node) {
                                            var match,
                                                languageId,
                                                currentNodeCount,
                                                j,
                            Severity: Major
                            Found in doc/scripts/sunlight.js - About 2 hrs to fix

                              Function D has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function D(a, m) {
                                  function e(a) {
                                    switch (a.nodeType) {
                                    case 1:
                                      if (k.test(a.className)) break;
                              Severity: Major
                              Found in doc/scripts/prettify/prettify.js - About 2 hrs to fix

                                Function x has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function x(a, m) {
                                    function e(a) {
                                      for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) {
                                        var f = g[n],
                                            b = r[f],
                                Severity: Major
                                Found in doc/scripts/prettify/prettify.js - About 2 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (myEvent instanceof Array) {
                                              event.events = myEvent;
                                              debug('Event array length ' + event.events.length);
                                          } else {
                                              if (!(mEvent instanceof self.MoogEvent)) {
                                  Severity: Critical
                                  Found in lib/node-moog.js - About 2 hrs to fix

                                    Function is has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      p.is = function(what) {
                                        var ip = false;
                                        var ip4 = false;
                                        var ip6 = false;
                                        var name = false;
                                    Severity: Minor
                                    Found in doc/scripts/URI.js - About 1 hr to fix

                                      Function normalizePath has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        p.normalizePath = function(build) {
                                          if (this._parts.urn) {
                                            return this;
                                          }
                                          if (!this._parts.path || this._parts.path === '/') {
                                      Severity: Minor
                                      Found in doc/scripts/URI.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language