sideroad/wd-ct

View on GitHub

Showing 21 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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                  if(validateBrowserError) {
                                    dfd = dfd.then(function(){
                                      return browser.getBrowserErrors().then(function(errs){
                                        if(errs.length){
                                          throw new Error(errs.join('\n'));
                Severity: Major
                Found in src/wd-ct.js and 1 other location - About 2 hrs to fix
                src/wd-ct.js on lines 242..253

                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 90.

                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

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                  if(validateMarkupWarning) {
                                    dfd = dfd.then(function(){
                                      return browser.getMarkupWarning().then(function(errs){
                                        if(errs.length){
                                          throw new Error(errs.join('\n'));
                Severity: Major
                Found in src/wd-ct.js and 1 other location - About 2 hrs to fix
                src/wd-ct.js on lines 230..241

                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 90.

                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

                Further Reading

                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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    info = options.info ? function(){
                      var args = Array.prototype.slice.call(arguments);
                      infoLogger.write(args.join(' ')+'\n');
                    } : function(){};
                  Severity: Major
                  Found in src/wd-ct.js and 1 other location - About 1 hr to fix
                  src/wd-ct.js on lines 102..105

                  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 73.

                  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

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    debug = options.debug ? function(){
                      var args = Array.prototype.slice.call(arguments);
                      debugLogger.write(args.join(' ')+'\n');
                    } : function(){};
                  Severity: Major
                  Found in src/wd-ct.js and 1 other location - About 1 hr to fix
                  src/wd-ct.js on lines 97..100

                  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 73.

                  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

                  Further Reading

                  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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                            body.push( _.map(data, function(obj){
                              return String( !obj.value && isNaN(obj.value) ? '' : obj.value );
                            }));
                    Severity: Minor
                    Found in src/load-testcase.js and 1 other location - About 50 mins to fix
                    src/load-testcase.js on lines 56..58

                    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 51.

                    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

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                              header = _.map(data, function(obj){
                                return String( !obj.value && isNaN(obj.value) ? '' : obj.value );
                              });
                    Severity: Minor
                    Found in src/load-testcase.js and 1 other location - About 50 mins to fix
                    src/load-testcase.js on lines 62..64

                    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 51.

                    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

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                              if(commands.after) {
                                queue({
                                  command: 'after',
                                  fn: commands.after,
                                  val: '',
                    Severity: Minor
                    Found in src/wd-ct.js and 1 other location - About 40 mins to fix
                    src/wd-ct.js on lines 345..353

                    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 48.

                    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

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                              if(commands.before) {
                                queue({
                                  command: 'before', 
                                  fn: commands.before,
                                  val: '',
                    Severity: Minor
                    Found in src/wd-ct.js and 1 other location - About 40 mins to fix
                    src/wd-ct.js on lines 407..415

                    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 48.

                    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

                    Further Reading

                    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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        errorLogger: {write:function(mes){console.log(((mes||'').replace(/\n$/, '')).red);}},
                    Severity: Minor
                    Found in src/wd-ct.js and 1 other location - About 30 mins to fix
                    src/wd-ct.js on lines 62..62

                    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 45.

                    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

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language