Showing 590 of 590 total issues
Function getUserType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
groups.getUserType = function (groupId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Function updateResult
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
activities.updateResult = function (activityId, resultId, update, username, esClient) {
Function setGameVisualizationByTemplate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
kibana.setGameVisualizationByTemplate = function (gameId, id, visualization, fields, esClient) {
Function getUserType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var getUserType = function(classRes, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Function createOfflinetraces
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
offlinetraces.createOfflinetraces = function (activityId, username, req, res, kahoot) {
Function createIndex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
kibana.createIndex = function(config, indexName, indexTemplateId, user, esClient) {
Function isAuthorizedForExternal
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
classes.isAuthorizedForExternal = function(domain, externalId, username, method, call) {
Function getUserType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
groupings.getUserType = function(groupingId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Function getUserType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
classes.getUserType = function(classId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Function getUserTypeForArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
groupings.getUserTypeForArray = function(groupingIds, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Function createKibanaIndices
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
kibana.createKibanaIndices = function (indexName, indexTemplateId, user, config, esClient) {
Function connectToDB
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var connectToDB = function (connectionString, dbVar) {
MongoClient.connect(connectionString, function (err, db) {
if (err) {
console.log(err);
console.log('Impossible to connect to MongoDB. Retrying in 5s');
- 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 7 (exceeds 5 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');
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var Collection = require('easy-collections');
var players = new Collection(require('./db'), 'players');
/**
- 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 parseCSV
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var parseCSV = function (trace) {
trace = trace.replace('\r', '');
var list = [];
var escape = false;
- 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 toTrace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var toTrace = function (statement, trace) {
var actor = statement.actor;
if (actor) {
var name = actor.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
Identical blocks of code found in 5 locations. Consider refactoring. Open
co(function* () {
let esClient = config.elasticsearch.esClient;
yield at(esClient.indices.refresh({index: '_all'}));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (add && body.title) {
update.$set = {};
update.$set.title = body.title;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 5 locations. Consider refactoring. Open
co(function* () {
let esClient = config.elasticsearch.esClient;
yield at(esClient.ping({requestTimeout: 2000}));
yield at(esClient.indices.refresh({index: '_all'}));
const responseIndices = yield at(esClient.cat.indices({format: 'json'}));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (add && body.name) {
update.$set = {};
update.$set.name = body.name;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76