Showing 87 of 107 total issues
Function getReportContent
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function getReportContent(jsonReport, fixedLevels) {
var res = ['<?xml version="1.0" encoding="UTF-8" ?>\n'];
function processError(error) {
var tagName = error.failure ? "failure" : "error";
- 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 test-server.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2012 Amadeus s.a.s.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Function writeReports
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
var writeReports = function (config, results, callback) {
var mkdirsCache = {};
var expectedCallbacks = 1;
var errors = null;
var decreaseCallbacks = function (err) {
- 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 slave-client.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global SockJS */
/*
* Copyright 2012 Amadeus s.a.s.
* 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 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (attester) {
var BaseTestType = attester.classes.BaseTestType;
var FileSet = attester.classes.FileSet;
var BrowserExcludesFileSet = attester.classes.BrowserExcludesFileSet;
Function writeReports
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
var writeReports = function (config, results, callback) {
var mkdirsCache = {};
var expectedCallbacks = 1;
var errors = null;
var decreaseCallbacks = function (err) {
Function exports
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (attesterServer, serverRoot) {
var listsPossibleReports = function () {
var list = [];
attesterServer.campaigns.forEach(function (campaign) {
var result = campaign.getCoverageResult();
Function iterate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
FileSet.prototype.iterate = function (entryCallback, endCallback) {
var self = this;
var root = this._root || "";
var waitingCallbacks = 0;
var decreaseCallbacks = 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 exports
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (attester) {
var BaseTestType = attester.classes.BaseTestType;
var TestsEnumerator = require('./at-tests-enumerator.js');
var url = attester.utils.url;
Function readATNewFileContent
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function readATNewFileContent(res, fileContent, fileName) {
var foundClassDef = null;
var walker = new UglifyJS.TreeWalker(function (node) {
var isAssignment = node instanceof UglifyJS.AST_Assign && node.operator == "=";
if (!isAssignment) return;
- 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 slave-server.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2012 Amadeus s.a.s.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Function readATNewFileContent
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readATNewFileContent(res, fileContent, fileName) {
var foundClassDef = null;
var walker = new UglifyJS.TreeWalker(function (node) {
var isAssignment = node instanceof UglifyJS.AST_Assign && node.operator == "=";
if (!isAssignment) return;
Function getReportContent
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getReportContent(jsonReport, fixedLevels) {
var res = ['<?xml version="1.0" encoding="UTF-8" ?>\n'];
function processError(error) {
var tagName = error.failure ? "failure" : "error";
Function taskFinished
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
taskFinished: function (event) {
var taskId = event.taskId;
var task = this.campaign.jsonReport.tasks[taskId];
var taskName = task.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 createPhantomExitCb
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
createPhantomExitCb: function (cfg, state, n) {
// Node 0.8 and 0.10 differently handle spawning errors ('exit' vs 'error'), but errors that happened after
// launching the command are both handled in 'exit' callback
return function (code, signal) {
// See http://tldp.org/LDP/abs/html/exitcodes.html and http://stackoverflow.com/a/1535733/
- 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 MochaTestType
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MochaTestType = function (campaign, inputConfig) {
// Default values for the configuration object
var testConfig = {
files: {
rootDirectory: process.cwd(),
Function readATClasspath
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
ATEnvironment.prototype.readATClasspath = function (classpath, callback) {
var classpathInfo = this._classpaths[classpath];
var self = this;
var filePath = null;
if (!classpathInfo) {
Function TestCampaign
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TestCampaign = function (config, parentLogger) {
this.results = config.liveResults ? [] : null;
this.startTime = new Date();
this.campaignNumber = config.campaignNumber;
this.id = createCampaignId(this.startTime);
Function readATClasspath
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
ATEnvironment.prototype.readATClasspath = function (classpath, callback) {
var classpathInfo = this._classpaths[classpath];
var self = this;
var filePath = null;
if (!classpathInfo) {
- 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 AriaTemplatesTests
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var AriaTemplatesTests = function (campaign, inputConfig) {
// Default values for the config:
var testConfig = {
rootFolderPath: '/',
bootstrap: null,