Showing 244 of 590 total issues
Function exports
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var Collection = require('easy-collections');
var db = require('./db');
var utils = require('./utils');
var courses = new Collection(db, 'courses');
Function exports
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var authTokens = require('./auth-tokens');
var players = require('./players');
var dataSource = require('./traces');
Function exports
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (request, db, config) {
config.mongodb.db = db;
/**-------------------------------------------------------------**/
/**-------------------------------------------------------------**/
Function createAnalysis
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
analysis.createAnalysis = function (versionId, username, req, res) {
versionId = analysis.toObjectID(versionId);
return analysis.findById(versionId)
.then(function (analysisResult) {
Function identifyExtensionsFromIndex
has a Cognitive Complexity of 32 (exceeds 5 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 = {};
- 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 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var Collection = require('easy-collections');
var authTokens = new Collection(require('./db'), 'authtokens');
var gameplays = require('./gameplays');
Function checkAttempts
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkAttempts(config, callback) {
var playersCollection = config.mongodb.db.collection('players');
var authTokensCollection = config.mongodb.db.collection('authtokens');
Function exports
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var hasKey = function (object, key) {
var o = object;
var matches = 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"
Further reading
Function exports
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var tracesConverter = require('./tracesConverter');
// Consumers interested in the incoming traces
var consumers = [];
Function createOfflinetraces
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
offlinetraces.createOfflinetraces = function (activityId, username, req, res, kahoot) {
activityId = offlinetraces.toObjectID(activityId);
var nofileMessage = '';
var trackingCode = '';
// 1 - Check if anactivity exists for the given activityId
Function getTarget
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
var getTarget = function (statement, trace) {
var object = statement.object;
if (object) {
var objectId = object.id;
var index;
- 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 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (request, app, db) {
var mongoController;
/**-------------------------------------------------------------**/
File classesTest.js
has 334 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 exports
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var Collection = require('easy-collections');
var db = require('./db');
var utils = require('./utils');
var groups = require('./groups');
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var Q = require('q');
var authTokens = require('./auth-tokens');
var players = require('./players');
var dataSource = require('./traces');
- 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 resolvePermissions
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
var resolvePermissions = function () {
var documentObj = {};
var look = [];
var mgetObj = {
Function kahootToCSV
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function kahootToCSV(file) {
try {
var buf = fs.readFileSync(file);
var wb = XLSX.read(buf, {type: 'buffer'});
var sheets = wb.SheetNames;
Function modifyClass
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
classes.modifyClass = function (classId, username, body, add) {
var participants = {};
if (!body.participants && body.students) {
participants.students = body.students;
delete body.students;
File offlinetraces.js
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
module.exports = function () {
var collector = require('./collector');
File elasticTransformerTo2.js
has 310 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.