Showing 24 of 26 total issues
Function analyze
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
exports.analyze = function(tokens) {
var root = new exports.Node();
while (tokens.length > 0) {
var cur = tokens.shift();
- 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 parseInnerScope
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function parseInnerScope(tokens, parent, root) {
var scope1 = expect(tokens, 'operator', '{');
var scope2 = optional(tokens, 'operator', '}');
while (!scope2) {
- 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 analyze
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.analyze = function(tokens) {
var root = new exports.Node();
while (tokens.length > 0) {
var cur = tokens.shift();
Function lookupSymbol
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
exports.lookupSymbol = function(tree, identifier, strongonly) {
var ident = identifierRegex.exec(identifier);
if (!ident) {
throw new Error("Invalid identifier specified " + identifier);
- 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 parseInnerScope
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseInnerScope(tokens, parent, root) {
var scope1 = expect(tokens, 'operator', '{');
var scope2 = optional(tokens, 'operator', '}');
while (!scope2) {
Function Dota2Client
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Dota2Client = function Dota2Client(user, gc, debug) {
EventEmitter.call(this);
this.debug = debug;
this._client = user._client;
Function emitClassEncoder
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function emitClassEncoder(cnode, baseSize) {
Steam.Internal[cnode.name].prototype.encode = function() {
// first emit variable length members
var varLengthProps = [];
Function encode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Steam.Internal[cnode.name].prototype.encode = function() {
// first emit variable length members
var varLengthProps = [];
cnode.childNodes.forEach(function(prop) {
Function emitClassConstructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function emitClassConstructor(cnode) {
Steam.Internal[cnode.name] = function(object) {
object = object || {};
cnode.childNodes.forEach(function(prop) {
Function getTypeSize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.getTypeSize = function(prop) {
var sym = prop.type;
// no static size for proto
if (prop.flags == 'proto') {
- 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 emitClassDecoder
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function emitClassDecoder(cnode) {
Steam.Internal[cnode.name].decode = function(buffer) {
if (!ByteBuffer.isByteBuffer(buffer)) {
buffer = ByteBuffer.wrap(buffer, ByteBuffer.LITTLE_ENDIAN);
}
Function decode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Steam.Internal[cnode.name].decode = function(buffer) {
if (!ByteBuffer.isByteBuffer(buffer)) {
buffer = ByteBuffer.wrap(buffer, ByteBuffer.LITTLE_ENDIAN);
}
Function lookupSymbol
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.lookupSymbol = function(tree, identifier, strongonly) {
var ident = identifierRegex.exec(identifier);
if (!ident) {
throw new Error("Invalid identifier specified " + identifier);
Function Dota2Client
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var Dota2Client = function Dota2Client(user, gc, debug) {
EventEmitter.call(this);
this.debug = debug;
this._client = user._client;
- 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 tokenizeString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.tokenizeString = function(buffer) {
var match;
var tokenList = [];
while ((match = regexPattern.exec(buffer))) {
- 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 gcClientConnectionStatus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
handlers[Dota2.EGCBaseClientMsg.k_EMsgGCClientConnectionStatus] = function gcClientConnectionStatus(message) {
/* Catch and handle changes in connection status, cuz reasons u know. */
var status = Dota2.CMsgConnectionStatus.decode(message).status;
util.log(util.inspect(message, false, null));
- 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 getTypeOfSize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.getTypeOfSize = function(size, unsigned) {
for (var key in weakTypeMap) {
if (weakTypeMap[key].size == size) {
if (unsigned && !weakTypeMap[key].signed)
return key;
- 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 emitCode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.emitCode = function(root, gen, sb, nspace, supportsGC, internalFile) {
Function onFriendsMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var onFriendsMessage = function onFriendsMessage(source, message, type, chatter){
// respond to both chat room and private messages
if (type == 1) //1, message; 2, typing
if(friends.personaStates[source] != undefined){
console.log('Received message: ' +message+' from '+friends.personaStates[source].player_name);
- 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 onGCToClientFindTopSourceTVGamesResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handlers[Dota2.EDOTAGCMsg.k_EMsgGCToClientFindTopSourceTVGamesResponse] = function onGCToClientFindTopSourceTVGamesResponse(message, callback) {
callback = callback || null;
var topSourceTVGamesResponse = Dota2.CMsgGCToClientFindTopSourceTVGamesResponse.decode(message);
debuglog(topSourceTVGamesResponse, 'topSourceTVGamesResponse');
if (typeof topSourceTVGamesResponse.games != 'undefined' && topSourceTVGamesResponse.games.length > 0) {
- 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"