Showing 22 of 104 total issues
File layer.js
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Verse Websocket Asynchronous Module
*
* The MIT License (MIT)
*
Function exports
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
'use strict';
// Project configuration.
//neco
File tag.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Verse Websocket Asynchronous Module
*
* The MIT License (MIT)
*
Function checkOpCode
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var checkOpCode = function checkOpCode(opCode, receivedView, bufferPosition) {
var length, feature, cmdValues, opCodes;
Function onSocketMessage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onSocketMessage = function onSocketMessage(message, config) {
var responseData;
if (message.data instanceof ArrayBuffer) {
if (!response.checkHeader(message.data)) {
Function setValue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function nodeHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nodeHandler = function nodeHandler(data) {
data.forEach(function(cmd) {
console.log(cmd);
if (cmd.CMD === 'NODE_CREATE') {
// Subscribe to every node
Function parseFeature
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseFeature = function parseFeature(feature, receivedView, bufferPosition, length) {
var value,
stringFeatures = {
3: 'HOST_URL',
4: 'TOKEN',
Function parse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parse: function(buffer) {
var opCode, cmdLen, result, payload;
var receivedView = new DataView(buffer);
var bufferPosition = 2;
Function getLayerSetUint64
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLayerSetUint64 = function getLayerSetUint64(opCode, receivedView, bufferPosition) {
var result, hi, lo, bigNumber;
result = getLayerCmdCommons(opCode, receivedView, bufferPosition);
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
'use strict';
// Project configuration.
//neco
- Read upRead up
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
Open
tagSet: function tagSet(prio, nodeId, tagGroupId, tagId, dataType, values) {
Function layerCreate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
layerCreate: function layerCreate(prio, nodeId, parentLayerId, dataType, count, customType) {
Function tagCreate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
tagCreate: function tagCreate(prio, nodeId, tagGroupId, dataType, count, customType) {
Function set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
set: function(nodeId, tagGroupId, tagId, dataType, values) {
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
create: function(nodeId, parentLayerId, dataType, count, customType) {
Function layerSetItems
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
layerSetItems: function layerSetItems(prio, nodeId, layerId, dataTypes, items) {
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
create: function(nodeId, tagGroupId, dataType, count, customType) {
Avoid too many return
statements within this function. Open
Open
return {
'group': 'LAYER',
'cmd': cmdValues
};
Avoid too many return
statements within this function. Open
Open
return {
'group': 'NEGO',
'cmd': {
CMD: opCode,
MESSAGE: '@TODO - opCode not implemented'