phodal/diaonan

View on GitHub

Showing 150 of 191 total issues

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

/*!
 * jQuery JavaScript Library v1.8.2
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in app/assets/js/jquery-1.8.2.js - About 2 wks to fix

    Function jsonlint has a Cognitive Complexity of 162 (exceeds 5 allowed). Consider refactoring.
    Open

    var jsonlint = (function(){
    var parser = {trace: function trace() { },
    yy: {},
    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
    terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
    Severity: Minor
    Found in app/assets/js/jsonlint.js - About 3 days 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 jsonlint has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var jsonlint = (function(){
    var parser = {trace: function trace() { },
    yy: {},
    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
    terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
    Severity: Major
    Found in app/assets/js/jsonlint.js - About 1 day to fix

      Function ajax has 237 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajax: function( url, options ) {
      
              // If url is an object, simulate pre-1.5 signature
              if ( typeof url === "object" ) {
                  options = url;
      Severity: Major
      Found in app/assets/js/jquery-1.8.2.js - About 1 day to fix

        Function lexer has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var lexer = (function(){var lexer = ({EOF:1,
        parseError:function parseError(str, hash) {
                if (this.yy.parseError) {
                    this.yy.parseError(str, hash);
                } else {
        Severity: Major
        Found in app/assets/js/jsonlint.js - About 5 hrs to fix

          Function support has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jQuery.support = (function() {
          
              var support,
                  all,
                  a,
          Severity: Major
          Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

            Function parse has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            parse: function parse(input) {
                var self = this,
                    stack = [0],
                    vstack = [null], // semantic value stack
                    lstack = [], // location stack
            Severity: Major
            Found in app/assets/js/jsonlint.js - About 5 hrs to fix

              Function Callbacks has 125 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jQuery.Callbacks = function( options ) {
              
                  // Convert options from String-formatted to Object-formatted if needed
                  // (we check in cache first)
                  options = typeof options === "string" ?
              Severity: Major
              Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( event.pageX == null && original.clientX != null ) {
                                eventDoc = event.target.ownerDocument || document;
                                doc = eventDoc.documentElement;
                                body = eventDoc.body;
                
                
                Severity: Critical
                Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

                  Function exports has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function (app) {
                      var Data, buildKey;
                      buildKey = function (key) {
                          return "topic:" + key;
                      };
                  Severity: Major
                  Found in app/models/data.js - About 4 hrs to fix

                    File jsonlint.js has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* Jison generated parser */
                    var jsonlint = (function(){
                    var parser = {trace: function trace() { },
                    yy: {},
                    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
                    Severity: Minor
                    Found in app/assets/js/jsonlint.js - About 4 hrs to fix

                      Function exports has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function (app) {
                          var Data;
                          Data = app.models.Data;
                          return function (client) {
                              var listeners, unsubscribeAll;
                      Severity: Major
                      Found in app/controllers/mqtt_api.js - About 3 hrs to fix

                        Function setupTopic has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function setupTopic(topic) {
                          var url = window.location.protocol + '//' + window.location.hostname;
                          if (window.location.port) {
                            url += ':' + window.location.port;
                          }
                        Severity: Major
                        Found in app/assets/js/topics.js - About 3 hrs to fix

                          Function trigger has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              trigger: function( event, data, elem, onlyHandlers ) {
                                  // Don't do events on text and comment nodes
                                  if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
                                      return;
                                  }
                          Severity: Major
                          Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

                            Function send has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            send: function( headers, complete ) {
                            
                                                // Get a new xhr
                                                var handle, i,
                                                    xhr = s.xhr();
                            Severity: Major
                            Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

                              Function defaultPrefilter has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function defaultPrefilter( elem, props, opts ) {
                                  var index, prop, value, length, dataShow, tween, hooks, oldfire,
                                      anim = this,
                                      style = elem.style,
                                      orig = {},
                              Severity: Major
                              Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

                                Function clean has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    clean: function( elems, context, fragment, scripts ) {
                                        var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
                                            safe = context === document && safeFragment,
                                            ret = [];
                                
                                
                                Severity: Major
                                Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

                                  Function exports has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function (app) {
                                      var Data;
                                      var _      = require("underscore");
                                  
                                      Data = app.models.Data;
                                  Severity: Major
                                  Found in app/controllers/coap_api.js - About 3 hrs to fix

                                    Function Animation has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function Animation( elem, properties, options ) {
                                        var result,
                                            index = 0,
                                            tweenerIndex = 0,
                                            length = animationPrefilters.length,
                                    Severity: Major
                                    Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

                                      Function add has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          add: function( elem, types, handler, data, selector ) {
                                      
                                              var elemData, eventHandle, events,
                                                  t, tns, type, namespaces, handleObj,
                                                  handleObjIn, handlers, special;
                                      Severity: Major
                                      Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language