Showing 51 of 88 total issues
Function onEvaluate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.onEvaluate = function () {
var urls = {},
currentUrl = document.location.href,
attribute,
tag,
- Create a ticketCreate a ticket
Function FSWrapper
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var FSWrapper = function (fs) {
if (fs === undefined) {
fs = require('fs');
}
- Create a ticketCreate a ticket
Function Pool
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Pool = function (os, config, fork) {
/**
* Settings queue.
*
* @property queue
- Create a ticketCreate a ticket
Function Session
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Session = function (client, fs, zlib, utils, conf, pool) {
/**
* Dump the Redis DB.
*
* @method dump
- Create a ticketCreate a ticket
Function parsePage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.parsePage = function (page) {
var url, links = {}, events;
currentParser.report.content = page.content;
- Create a ticketCreate a ticket
Function parseINIString
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.parseINIString = function (data) {
var regex = {
section: /^\s*\[\s*([^\]]*)\s*\]\s*$/,
param: /^\s*([\w\.\-\_\[\]]+)\s*=\s*(.*?)\s*$/,
comment: /^\s*;.*$/
- Create a ticketCreate a ticket
Function Pool
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
var Pool = function (os, config, fork) {
/**
* Settings queue.
*
* @property queue
- 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 SalmonJS
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
var SalmonJS = function (redis, argv) {
// TODO: convert to this.*
var IOC = require('./ioc'),
ioc = new IOC(),
logLevels = [ 'error', 'warn', 'info', 'debug' ],
- 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 createNewCaseFile
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.createNewCaseFile = function (url, name, data, callback) {
if (currentTest.TEST_CASE_DIRECTORY === undefined) {
return;
}
- Create a ticketCreate a ticket
Function analiseRedisResponse
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.analiseRedisResponse = function (err, reply, redisId, container) {
var id = redisId.substr(0, 8),
winstonCrawlerId = '[' + id.cyan + '-' + currentCrawler.idCrawler.magenta + ']',
newId;
- Create a ticketCreate a ticket
Function execSubProcess
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.execSubProcess = function () {
var idRequest = utils.sha1(this.url + this.type + JSON.stringify(this.data) + this.evt + this.xPath),
subprocess,
params = {
idCrawler: this.idUri,
- Create a ticketCreate a ticket
Function processQueue
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.processQueue = function () {
if (currentPool.queue.length === 0) {
return;
}
- Create a ticketCreate a ticket
Function handleError
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.handleError = function () {
var winstonCrawlerId = '[' + currentCrawler.idUri.cyan + '-' + this.idCrawler.magenta + ']';
if (currentCrawler.tries < config.crawler.attempts) {
winston.info('%s' + ' Trying again in %s msec'.grey, winstonCrawlerId, config.crawler.delay);
- Create a ticketCreate a ticket
Function parsePost
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.parsePost = function () {
this.handleQueryString();
this.setUpPage(this.page);
- Create a ticketCreate a ticket
Function checkAndRun
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.checkAndRun = function (settings) {
var container = {},
redisId,
id,
winstonCrawlerId;
- Create a ticketCreate a ticket
Function dump
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.dump = function (callback) {
var dump = {conf: conf, redis: {}, pool: {}};
dump.pool.size = pool.size;
dump.pool.queue = pool.queue;
- Create a ticketCreate a ticket
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.start = function() {
var uri = currentInstance.resolveURI(argv.uri);
winston.info('Start processing "' + uri.green + '"...');
- Create a ticketCreate a ticket
Function parseGet
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.parseGet = function () {
this.handleQueryString();
// InitPhantomJs
this.setUpPage(this.page);
- Create a ticketCreate a ticket
Function run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.run = function (settings) {
this.url = settings.url;
this.type = settings.type || 'GET';
this.data = settings.data || {
GET: {},
- Create a ticketCreate a ticket
Function onEvaluateNonHtml
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.onEvaluateNonHtml = function () {
var urls = {
mixed_full: [],
mixed_rel: [],
},
- Create a ticketCreate a ticket