Cellarise/istanbul-reporter-clover-limits

View on GitHub

Showing 29 of 58 total issues

Function closeBrowser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
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');
Severity: Minor
Found in Test/testUtils.js - About 1 hr to fix

    Function coverageStatsTasks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    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");
    Severity: Minor
    Found in tasks/coverageStats.js - About 1 hr to fix

      Function test has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      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"])
      Severity: Minor
      Found in Test/functional/Package-MDCOVSM-3-steps.js - About 1 hr to fix

        Function coverageStatsTasks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        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");
        Severity: Minor
        Found in tasks/coverageStats.js - About 1 hr to fix

        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

            function enableUI() {
                var i,
                    el,
                    ithSorter = function ithSorter(i) {
                        var col = cols[i];
        Severity: Minor
        Found in Test_Resources/code-coverage/non-bundled/sorter.js - About 1 hr to fix

          Function walk has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          var walk = function walk(node, collector, writer, level, projectRoot, jsonResults, limits) {
          Severity: Major
          Found in lib/clover-limits.js - About 50 mins to fix

            Function codeAnalysisTasks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            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`.
            Severity: Minor
            Found in tasks/codeAnalysis.js - About 45 mins to fix

            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

              if (linePercent < limits.statements ||
                branchesPercent < limits.branches ||
                functionsPercent < limits.functions ||
                lineIgnoredPercent > limits.ignored.statements ||
                branchesIgnoredPercent > limits.ignored.branches ||
            Severity: Major
            Found in lib/clover-limits.js - About 40 mins to fix

              Function addClassStats has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              var addClassStats = function addClassStats(node, fileCoverage, writer, jsonResults, limits) {
              Severity: Minor
              Found in lib/clover-limits.js - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language