Showing 88 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
- Read upRead up
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
Function EventContainer
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
var EventContainer = function () {
/**
* The Event Container.
*
* @property container
- Read upRead up
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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';
- Read upRead up
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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' ],
- Create a ticketCreate a ticket
File phantom.js
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* __ _____ _______
* .-----.---.-.| |.--------.-----.-----._| | __|
* |__ --| _ || || | _ | | |__ |
* |_____|___._||__||__|__|__|_____|__|__|_______|_______|
- Create a ticketCreate a ticket
Function Utils
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Utils = function (crypto) {
/**
* Serialise an object as questring.
*
* @method serialise
- Create a ticketCreate a ticket
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';
- Create a ticketCreate a ticket
File crawler.js
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* __ _____ _______
* .-----.---.-.| |.--------.-----.-----._| | __|
* |__ --| _ || || | _ | | |__ |
* |_____|___._||__||__|__|__|_____|__|__|_______|_______|
- Create a ticketCreate a ticket
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';
- Create a ticketCreate a ticket
Function EventContainer
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
var EventContainer = function () {
/**
* The Event Container.
*
* @property container
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var cookie in this.data.COOKIE) {
if (this.data.COOKIE.hasOwnProperty(cookie)) {
var domain = '';
if (this.url.substr(0, 7) !== 'file://') {
domain = this.url.replace(/^http(s)?:\/\/([^\/]+)\/?.*$/, '$2');
- Read upRead up
- Create a ticketCreate a ticket
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 134.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var cookie in this.data.COOKIE) {
if (this.data.COOKIE.hasOwnProperty(cookie)) {
var domain = '';
if (this.url.substr(0, 7) !== 'file://') {
domain = this.url.replace(/^http(s)?:\/\/([^\/]+)\/?.*$/, '$2');
- Read upRead up
- Create a ticketCreate a ticket
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 134.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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' ],
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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,
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.overrideAttributeHandler = function (object) {
var prototype = object.prototype === undefined ? object : object.prototype;
prototype._origSetAttribute = prototype.setAttribute;
prototype.setAttribute = currentEventContainer.customSetAttribute;
- Read upRead up
- Create a ticketCreate a ticket
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 106.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76