Showing 291 of 291 total issues
Function EcMaker
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.EcMaker = function () {
var fs = require('fs-extra');
var path = require('path');
var ecmaker = require('../../lib/ecmake.js');
var outpath;
- 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 pkbGetter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pkbGetter(platform, pkb) {
var missingFile = path.join(__dirname, '/../platforms/', platform, 'pkb', platform +
'.pkb.miss.txt');
var missQueue = async.queue(function (titleID, callback) {
Function readFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function readFile() {
const file = files.pop();
if (!file) { return callback(null, Object.keys(robots).length); }
const type = file.substr(0, file.indexOf('.'));
Function Organizer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Organizer() {
var self = this;
var buffer = new Map();
var next = 1;
var last = false;
Function nextFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var nextFile = function () {
var file = files[i++];
if (!file) { process.exit(status); }
pkbValidator.validate(file)
Function readConfig
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.readConfig = function () {
var config = require('../config.js');
var pkg = require('../../package.json');
Function Writer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Writer = function (outputStream, outputFields) {
var self = this;
outputFields = outputFields || [];
outputStream.on('drain', function () {
Identical blocks of code found in 2 locations. Consider refactoring. Open
fields.removed.forEach(function (field) {
var index = outputFields.indexOf(field);
if (index !== -1) {
outputFields.splice(index, 1);
}
- 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 61.
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 2 locations. Consider refactoring. Open
var yargs = require('yargs')
.usage('Usage: $0 --platform=[string] --nb=[num] --rate=[num] --duration=[seconds]\nExample: $0 --platform="sd|npg" --rate=100 --duration=10')
.demand('platform').default('platform', '-')
.demand('nb').alias('nb', 'n').default('nb', 'nolimit')
.demand('rate').alias('rate', 'r').default('rate', 10)
- 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 61.
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 2 locations. Consider refactoring. Open
fields.removed.forEach(function (field) {
var index = outputFields.indexOf(field);
if (index !== -1) {
outputFields.splice(index, 1);
}
- 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 61.
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 2 locations. Consider refactoring. Open
var yargs = require('yargs')
.usage('Extract specific fields from a log stream\nUsage: $0 --fields=[string] --separator=";"')
.demand('fields').alias('fields', 'f')
.demand('separator').alias('separator', 'sep').alias('separator', 's').default('separator', '\t')
- 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 61.
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
Function getMiddlewaresData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getMiddlewaresData() {
const middlewaresFolder = path.resolve(__dirname, '../middlewares');
const result = await dbConfig.getConfig('middlewares');
const savedMiddlewares = result && result.data;
Function readNextDir
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
(async function readNextDir(callback) {
const folder = folders[i++];
if (!folder) { return callback(); }
if (folder == 'js-parser-skeleton') { return readNextDir(callback); }
Function extract
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.extract = function (source, options, callback) {
if (typeof options == 'function') {
callback = options;
options = {};
}
- 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 update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
ReportManager.prototype.update = function (callback, noWait) {
var self = this;
if (noWait) {
if (typeof callback === 'function') {
- 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 logInjector
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.logInjector = function () {
var fs = require('fs-extra');
var request = require('request');
var config = require('../config.js');
- 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 clearCache
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function clearCache(filePath) {
if (!filePath) { return Promise.resolve(); }
return new Promise((resolve, reject) => {
fs.stat(filePath, (err, stat) => {
Function getCertifications
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.getCertifications = (docurl) => new Promise((resolve, reject) => {
const requestOptions = {
method: 'GET',
url: 'http://analyses.ezpaarse.org/api/platforms',
json: true,
Function logFaker
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.logFaker = function () {
var logF = require('../logfaker.js');
// get the command line argument
Function getPkbPackages
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getPkbPackages = function (pkbDir, callback) {
fs.readdir(pkbDir, function (err, files) {
if (err && err.code != 'ENOENT') { return callback(err); }
files = files || [];