preceptorjs/taxi

View on GitHub

Showing 53 of 286 total issues

File chain.js has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var logMethods = require('./log');
var type = require('./type');
var when = require('./when');
Severity: Major
Found in lib/chain.js - About 1 day to fix

File screenshot.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var logMethods = require('../log');
var type = require('../type');
var when = require('../when');
Severity: Minor
Found in lib/helpers/screenshot.js - About 6 hrs to fix

Function load has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    load: function () {

        function versionInfo () {
            return {
                major: 1,
Severity: Major
Found in lib/scripts/structure.js - About 4 hrs to fix

Function load has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    load: function () {

        function versionInfo () {
            return {
                major: 1,
Severity: Minor
Found in lib/scripts/structure.js - About 4 hrs 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 _parseResponse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

Connection.prototype._parseResponse = function (res, requestData, options) {

  var body,
      data,
      filePath,
Severity: Minor
Found in lib/connection.js - About 3 hrs 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

File driver.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var EventEmitter = require('events').EventEmitter;
var util = require('util');
var url = require('url');
Severity: Minor
Found in lib/driver.js - About 3 hrs to fix

File nightwatch.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var logMethods = require('../log');
var type = require('../type');
var when = require('../when');
Severity: Minor
Found in lib/compatibility/nightwatch.js - About 2 hrs to fix

Function compare has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

BlinkDiffComparison.prototype.compare = function (title, imageBlob, options) {

    var instance,
        diffPath, buildPath, approvedPath,
        result, passed, localOptions;
Severity: Minor
Found in lib/comparison/blinkdiff.js - About 2 hrs 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 _gatherSections has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Screenshot.prototype._gatherSections = function (area, padding, initData, maxImageResolution, needsStitching) {

    var sections = [], section,
        sectionCount, sectionHeight,
        i, index = 0,
Severity: Minor
Found in lib/helpers/screenshot.js - About 1 hr to fix

Function _parseResponse has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Connection.prototype._parseResponse = function (res, requestData, options) {

  var body,
      data,
      filePath,
Severity: Minor
Found in lib/connection.js - About 1 hr to fix

Function domInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function domInfo () {

            var capturedTags = ["A", "SPAN", "OL", "UL", "LI", "HEADER", "FOOTER", "NAV", "ARTICLE", "SECTION", "ASIDE", "DIV", "APPLET", "CANVAS", "VIDEO", "TABLE", "DETAILS", "SUMMARY", "IFRAME", "MENU", "MAIN", "FIGURE", "FIELDSET"];

            function loadDOMNode (inputNode, parentNode) {
Severity: Minor
Found in lib/scripts/structure.js - About 1 hr to fix

Function _takeScreenshot has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Screenshot.prototype._takeScreenshot = function (fn, options) {

    var DevicePixelRatio = require('./devicePixelRatio'),
        devicePixelRatio = new DevicePixelRatio(this.getDriver()),

Severity: Minor
Found in lib/helpers/screenshot.js - About 1 hr to fix

Function _determineBlockOuts has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Screenshot.prototype._determineBlockOuts = function (area, context, blockOuts, blockOutColor) {

    var defaultColor = blockOutColor || { red: 0, green: 0, blue: 0 };

    return when(this.getDriver().utils().map(blockOuts, function (blockOutEl) {
Severity: Minor
Found in lib/helpers/screenshot.js - About 1 hr to fix

Function init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init: function (needsStitching) {

        var initData = {
                viewPort: {},
                document: {},
Severity: Minor
Found in lib/scripts/screenshot.js - About 1 hr to fix

Function compare has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

BlinkDiffComparison.prototype.compare = function (title, imageBlob, options) {

    var instance,
        diffPath, buildPath, approvedPath,
        result, passed, localOptions;
Severity: Minor
Found in lib/comparison/blinkdiff.js - About 1 hr to fix

Function setupDebug has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setupDebug (driver, options) {
  var indentation = 0;

  function stringFill (filler, length) {
    var buffer = new Buffer(length);
Severity: Minor
Found in lib/driver.js - About 1 hr to fix

Function _browserPadding has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Screenshot.prototype._browserPadding = function (padding) {

    var paddingViewPortTop = 0, paddingViewPortBottom = 0,
        paddingViewPortLeft = 0, paddingViewPortRight = 0,
        paddingScreenshotTop = 0, paddingScreenshotBottom = 0,
Severity: Minor
Found in lib/helpers/screenshot.js - About 1 hr to fix

Function init has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init: function (horizontalPadding) {
        var de = document.documentElement,
            body = document.body,
            el, initData;

Severity: Minor
Found in lib/scripts/devicePixelRatio.js - About 1 hr to fix

Function Driver has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Driver (remote, capabilities, options) {
  EventEmitter.call(this);

  type('remote', remote, 'String|Object');
  type('capabilities', capabilities, 'Object');
Severity: Minor
Found in lib/driver.js - About 1 hr to fix

Function type has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function type (val) {
  switch (Object.prototype.toString.call(val)) {
    case '[object Date]':
      return 'Date';
    case '[object RegExp]':
Severity: Minor
Found in lib/type.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

Severity
Category
Status
Source
Language