sideroad/wd-ct

View on GitHub

Showing 11 of 21 total issues

Function WdCT has 418 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var WdCT = function(options){
  var info,
      debug,
      error,
      reporter,
Severity: Major
Found in src/wd-ct.js - About 2 days to fix

    Function executeWd has 301 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var executeWd = function(server){
    
        (parallel ? async.each : async.mapSeries).call( async, options.browsers, function(browserName, callback){
          var promise,
              commands,
    Severity: Major
    Found in src/wd-ct.js - About 1 day to fix

      Function WdCT has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      var WdCT = function(options){
        var info,
            debug,
            error,
            reporter,
      Severity: Minor
      Found in src/wd-ct.js - About 1 day 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 execute has 192 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function execute(header, body, callback){
                var queue = function(args){
                      var command = args.command,
                          fn = args.fn,
                          val = args.val,
      Severity: Major
      Found in src/wd-ct.js - About 7 hrs to fix

        File wd-ct.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * wd-ct
         * https://github.com/sideroad/wd-ct
         *
         * Copyright (c) 2014 sideroad
        Severity: Minor
        Found in src/wd-ct.js - About 6 hrs to fix

          Function adapt has 159 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            adapt: function(wd, store, logger){
              var fs = require('fs'),
                  _ = require('lodash'),
                  path = require('path'),
                  Q = require('q'),
          Severity: Major
          Found in src/wd-extension.js - About 6 hrs to fix

            Function exports has 137 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(options, callback){
              var prompt = require('prompt'),
                  fs = require('fs'),
                  path = require('path'),
                  async = require('async'),
            Severity: Major
            Found in src/wd-ct-scaffold.js - About 5 hrs to fix

              Function queue has 125 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        var queue = function(args){
                              var command = args.command,
                                  fn = args.fn,
                                  val = args.val,
                                  col = args.col,
              Severity: Major
              Found in src/wd-ct.js - About 5 hrs to fix

                Function exports has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function (testcase, startColumn, callback){
                  var header = [],
                      body = [],
                      csv = require('fast-csv'),
                      xlsx = require('node-xlsx'),
                Severity: Major
                Found in src/load-testcase.js - About 2 hrs to fix

                  Function exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function(grunt) {
                  
                    grunt.initConfig({
                      clean: ['tmp/*'],
                      jshint: {
                  Severity: Minor
                  Found in Gruntfile.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function (testcase, startColumn, callback){
                      var header = [],
                          body = [],
                          csv = require('fast-csv'),
                          xlsx = require('node-xlsx'),
                    Severity: Minor
                    Found in src/load-testcase.js - About 35 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

                    Severity
                    Category
                    Status
                    Source
                    Language