Showing 29 of 58 total issues
Function closeBrowser
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"closeBrowser": function closeBrowser(worldContext, done) {
var browser = this.browsers.length > 0 ? this.browsers[0] : null;
if (browser && worldContext.browser.remote) { //if .remote exists then web server and browser available to kill
worldContext.browser.request(_opts.url + '/coverage', function handler(error, response, body) {
var vasync = require('vasync');
Function coverageStatsTasks
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function coverageStatsTasks(gulp, context) {
var jeditor = require("gulp-json-editor");
var gutil = require("gulp-util");
var logger = context.logger;
var fs = require("fs");
Function test
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.define("When I run coverage report on the files", function test(done) {
var logger = this.world.logger;
var COVERAGE_VARIABLE = "$$1cov_" + new Date().getTime() + "$$";
gulp.src(["Test_Resources/resources/non-bundled/**/*.js"])
Function coverageStatsTasks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function coverageStatsTasks(gulp, context) {
var jeditor = require("gulp-json-editor");
var gutil = require("gulp-util");
var logger = context.logger;
var fs = require("fs");
- 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 enableUI
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
Function walk
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var walk = function walk(node, collector, writer, level, projectRoot, jsonResults, limits) {
Function codeAnalysisTasks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function codeAnalysisTasks(gulp, context) {
var eslint = require("gulp-eslint");
/**
* A gulp build task to execute static code analysis on the files at `package.json:directories.lib`.
- 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
Consider simplifying this complex logical expression. Open
Open
if (linePercent < limits.statements ||
branchesPercent < limits.branches ||
functionsPercent < limits.functions ||
lineIgnoredPercent > limits.ignored.statements ||
branchesIgnoredPercent > limits.ignored.branches ||
Function addClassStats
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var addClassStats = function addClassStats(node, fileCoverage, writer, jsonResults, limits) {