Showing 244 of 590 total issues
Function storm
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
var storm = function (stormConfig, zookeeperUrl, kafkaUrl) {
var genYMLAndLaunch = function (src, ymlPath, stormJar, config) {
var deferred = Q.defer();
Function kafkaService
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
var kafkaService = function (clientUri) {
var cl;
var pr;
var co;
File transformToVersion4.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function upgradeAttempts
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upgradeAttempts(config, callback) {
// Transformers
var playersCollection = config.mongodb.db.collection('players');
var authTokensCollection = config.mongodb.db.collection('authtokens');
Function exports
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (request, db, config) {
/**-------------------------------------------------------------**/
/**-------------------------------------------------------------**/
/** Test Tracker **/
- 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 exports
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var tracesConverter = require('./tracesConverter');
// Consumers interested in the incoming traces
var consumers = [];
- 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 exports
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(request, db) {
/**-------------------------------------------------------------**/
/**-------------------------------------------------------------**/
/** Test Versions API **/
Function exports
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function() {
var Collection = require('easy-collections');
var _ = require('underscore');
var db = require('./db');
var versions = new Collection(db, 'versions');
Function identifyExtensionsFromIndex
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* identifyExtensionsFromIndex(esClient, index) {
let oldMapping = yield at(esClient.indices.getMapping({index: index.index}));
let upgradeIndex = 'upgrade_' + index.index;
let mapping = {};
Function upgradeGameIndex
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* upgradeGameIndex(esClient, gameIndex) {
let totalSessionsVis = yield at(esClient.get({
index: gameIndex.index,
type: 'visualization',
Function compareDocuments
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
var compareDocuments = function (doc1, doc2, ignoredFields) {
if (ignoredFields === undefined || ignoredFields === null) {
ignoredFields = ['uuidv4'];
}
Function exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
// Code adapted from http://stackoverflow.com/a/18402335/15472
grunt.registerTask('default', function () {
File activitiesTest.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function guessModelVersion
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
MongoController.prototype.guessModelVersion = function(db, callback) {
console.log('Starting to guess mongo model version!');
var minVersion = '1';
db.db.collections(function (error, collections) {
Function checkGameplay
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var checkGameplay = function(gameplay, callback) {
// Check new player fields
var err = null;
if (!gameplay.playerName) {
err = 'A gameplay does not contain its player name.';
Function roll
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function roll(callback) {
var refreshes = {};
for (var key in controllers) {
var controller = controllers[key];
Function exports
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var Collection = require('easy-collections');
var db = require('./db');
var games = new Collection(db, 'games');
- 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 buildXAPIProfile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
var buildXAPIProfile = function (statement, trace) {
var eventError = getEvent(statement, trace);
if (eventError) {
return eventError;
}
- 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
File groups.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
module.exports = (function () {
var Collection = require('easy-collections');
var db = require('./db');
Function start
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function (body, trackingCode, authorization, username) {
// First we look for the activity
return activities.find({
trackingCode: trackingCode
}, true).then(function (activity) {