verse/verse-javascript

View on GitHub

Showing 22 of 104 total issues

File layer.js has 397 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Verse Websocket Asynchronous Module
 *
 * The MIT License (MIT)
 *
Severity: Minor
Found in src/layer.js - About 5 hrs to fix

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

    module.exports = function(grunt) {
        'use strict';
    
        // Project configuration.
        //neco
    Severity: Major
    Found in Gruntfile.js - About 4 hrs to fix

      File tag.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Verse Websocket Asynchronous Module 
       *
       * The MIT License (MIT)
       *
      Severity: Minor
      Found in src/tag.js - About 4 hrs to fix

        Function checkOpCode has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var checkOpCode = function checkOpCode(opCode, receivedView, bufferPosition) {
        
                var length, feature, cmdValues, opCodes;
        
        
        
        Severity: Major
        Found in src/response.js - About 2 hrs to fix

          Function onSocketMessage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  onSocketMessage = function onSocketMessage(message, config) {
                      var responseData;
          
                      if (message.data instanceof ArrayBuffer) {
                          if (!response.checkHeader(message.data)) {
          Severity: Minor
          Found in src/verse.js - About 1 hr to fix

            Function setValue has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    setValue: function(hi, lo) {
                        var negate = false;
                        if (arguments.length === 1) {
                            if (typeof(hi) === 'number') {
                                // Simplify bitfield retrieval by using abs() value.  We restore sign
            Severity: Minor
            Found in src/Int64.js - About 1 hr to fix

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

                  nodeHandler = function nodeHandler(data) {
                      data.forEach(function(cmd) {
                          console.log(cmd);
                          if (cmd.CMD === 'NODE_CREATE') {
                              // Subscribe to every node
              Severity: Minor
              Found in example/app_standalone.js - About 1 hr to fix

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

                    var parseFeature = function parseFeature(feature, receivedView, bufferPosition, length) {
                        var value,
                            stringFeatures = {
                                3: 'HOST_URL',
                                4: 'TOKEN',
                Severity: Minor
                Found in src/negotiation.js - About 1 hr to fix

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

                          parse: function(buffer) {
                              var opCode, cmdLen, result, payload;
                              var receivedView = new DataView(buffer);
                              var bufferPosition = 2;
                  
                  
                  Severity: Minor
                  Found in src/response.js - About 1 hr to fix

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

                        getLayerSetUint64 = function getLayerSetUint64(opCode, receivedView, bufferPosition) {
                            var result, hi, lo, bigNumber;
                    
                            result = getLayerCmdCommons(opCode, receivedView, bufferPosition);
                    
                    
                    Severity: Minor
                    Found in src/layer.js - About 1 hr to fix

                      Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function(grunt) {
                          'use strict';
                      
                          // Project configuration.
                          //neco
                      Severity: Minor
                      Found in Gruntfile.js - About 55 mins 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 tagSet has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                  tagSet: function tagSet(prio, nodeId, tagGroupId, tagId, dataType, values) {
                      Severity: Minor
                      Found in src/verse.js - About 45 mins to fix

                        Function layerCreate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                    layerCreate: function layerCreate(prio, nodeId, parentLayerId, dataType, count, customType) {
                        Severity: Minor
                        Found in src/verse.js - About 45 mins to fix

                          Function tagCreate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                      tagCreate: function tagCreate(prio, nodeId, tagGroupId, dataType, count, customType) {
                          Severity: Minor
                          Found in src/verse.js - About 45 mins to fix

                            Function set has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                     set: function(nodeId, tagGroupId, tagId, dataType, values) {
                            Severity: Minor
                            Found in src/tag.js - About 35 mins to fix

                              Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      create: function(nodeId, parentLayerId, dataType, count, customType) {
                              Severity: Minor
                              Found in src/layer.js - About 35 mins to fix

                                Function layerSetItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                            layerSetItems: function layerSetItems(prio, nodeId, layerId, dataTypes, items) {
                                Severity: Minor
                                Found in src/verse.js - About 35 mins to fix

                                  Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          create: function(nodeId, tagGroupId, dataType, count, customType) {
                                  Severity: Minor
                                  Found in src/tag.js - About 35 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return {
                                                    'group': 'LAYER',
                                                    'cmd': cmdValues
                                                };
                                    Severity: Major
                                    Found in src/response.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  return {
                                                      'group': 'NEGO',
                                                      'cmd': {
                                                          CMD: opCode,
                                                          MESSAGE: '@TODO - opCode not implemented'
                                      Severity: Major
                                      Found in src/response.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language