fabiocicerchia/salmonjs

View on GitHub

Showing 51 of 88 total issues

Function PhantomParser has a Cognitive Complexity of 176 (exceeds 5 allowed). Consider refactoring.
Open

var PhantomParser = function (utils, spawn, page, settings) {
    /**
     * The WebPage element.
     *
     * @property page
Severity: Minor
Found in src/parser/phantom.js - About 3 days 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 PhantomParser has 456 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var PhantomParser = function (utils, spawn, page, settings) {
    /**
     * The WebPage element.
     *
     * @property page
Severity: Major
Found in src/parser/phantom.js - About 2 days to fix

Function Crawler has 421 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Crawler = function (config, spawn, test, client, winston, fs, optimist, utils) {
    /**
     * Number of tries before stop to execute the same request.
     *
     * @property tries
Severity: Major
Found in src/crawler.js - About 2 days to fix

Function EventContainer has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
Open

var EventContainer = function () {
    /**
     * The Event Container.
     *
     * @property container
Severity: Minor
Found in src/events.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 Crawler has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

var Crawler = function (config, spawn, test, client, winston, fs, optimist, utils) {
    /**
     * Number of tries before stop to execute the same request.
     *
     * @property tries
Severity: Minor
Found in src/crawler.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 reporter has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

var reporter = function (utils) {
    this.generateHTML = function (currentCrawler, reportName, report) {
        var i, j, failed, html = '<!DOCTYPE html>\n';

        html += '<html lang="en">\n';
Severity: Minor
Found in src/reporter/report.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 Utils has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

var Utils = function (crypto) {
    /**
     * Serialise an object as questring.
     *
     * @method serialise
Severity: Minor
Found in src/utils.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 exports has 194 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {
    grunt.initConfig({
        jasmine_node: {
            coverage: {
                report: [ 'lcov', 'html' ],
Severity: Major
Found in Gruntfile.js - About 7 hrs to fix

File phantom.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *               __                         _____ _______
 * .-----.---.-.|  |.--------.-----.-----._|     |     __|
 * |__ --|  _  ||  ||        |  _  |     |       |__     |
 * |_____|___._||__||__|__|__|_____|__|__|_______|_______|
Severity: Minor
Found in src/parser/phantom.js - About 7 hrs to fix

Function Utils has 184 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Utils = function (crypto) {
    /**
     * Serialise an object as questring.
     *
     * @method serialise
Severity: Major
Found in src/utils.js - About 7 hrs to fix

Function reporter has 156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var reporter = function (utils) {
    this.generateHTML = function (currentCrawler, reportName, report) {
        var i, j, failed, html = '<!DOCTYPE html>\n';

        html += '<html lang="en">\n';
Severity: Major
Found in src/reporter/report.js - About 6 hrs to fix

File crawler.js has 424 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *               __                         _____ _______
 * .-----.---.-.|  |.--------.-----.-----._|     |     __|
 * |__ --|  _  ||  ||        |  _  |     |       |__     |
 * |_____|___._||__||__|__|__|_____|__|__|_______|_______|
Severity: Minor
Found in src/crawler.js - About 6 hrs to fix

Function generateHTML has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.generateHTML = function (currentCrawler, reportName, report) {
        var i, j, failed, html = '<!DOCTYPE html>\n';

        html += '<html lang="en">\n';
        html += '    <head>\n';
Severity: Major
Found in src/reporter/report.js - About 6 hrs to fix

Function EventContainer has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var EventContainer = function () {
    /**
     * The Event Container.
     *
     * @property container
Severity: Major
Found in src/events.js - About 5 hrs to fix

Function SalmonJS has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var SalmonJS = function (redis, argv) {
    // TODO: convert to this.*
    var IOC       = require('./ioc'),
        ioc       = new IOC(),
        logLevels = [ 'error', 'warn', 'info', 'debug' ],
Severity: Major
Found in src/main.js - About 4 hrs to fix

Function Test has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

var Test = function (fsWrapper, glob, mainDir, utils, cases_dir) {
    /**
     * Test case directory.
     *
     * @property TEST_CASE_DIRECTORY
Severity: Minor
Found in src/test.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 processPage has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.processPage = function (content) {
        currentCrawler.processing = true;

        var result,
            links,
Severity: Major
Found in src/crawler.js - About 4 hrs to fix

Function Test has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Test = function (fsWrapper, glob, mainDir, utils, cases_dir) {
    /**
     * Test case directory.
     *
     * @property TEST_CASE_DIRECTORY
Severity: Major
Found in src/test.js - About 3 hrs to fix

Function FSWrapper has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

var FSWrapper = function (fs) {
    if (fs === undefined) {
        fs = require('fs');
    }

Severity: Minor
Found in src/fs.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

Function Parser has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function Parser() {
    /**
     * URL.
     *
     * @property url
Severity: Major
Found in src/parser.js - About 3 hrs to fix
Severity
Category
Status
Source
Language