Showing 51 of 88 total issues
Function onLoadFinished
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.onLoadFinished = function () {
if (settings.sanitise !== undefined && settings.sanitise.toString() === 'true') {
var tmp_fn = fs.workingDirectory + '/file_' + ((new Date()).getTime()) + '.html',
args = [ fs.workingDirectory + '/src/tidy.js', tmp_fn ],
process;
- Create a ticketCreate a ticket
Function list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
list: function (dir, done) {
var FSWrapper = require('./fs'),
fsWrapper = new FSWrapper(),
results = [],
list = fsWrapper.readdirSync(dir),
- Create a ticketCreate a ticket
Function Crawler
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var Crawler = function (config, spawn, test, client, winston, fs, optimist, utils) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (report.resources[i].headers.hasOwnProperty(j)) {
html += report.resources[i].headers[j].name + ': ' + report.resources[i].headers[j].value + '\n';
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (attribute.hasOwnProperty(attr)) {
elements = document.querySelectorAll(tag);
links = [];
if (elements.length > 0) {
links = [].map.call(elements, function (item) {
- Create a ticketCreate a ticket
Function Session
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var Session = function (client, fs, zlib, utils, conf, pool) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (events[curr_attr] === undefined) {
events[curr_attr] = [];
}
- Create a ticketCreate a ticket
Function Parser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function Parser() {
/**
* URL.
*
* @property url
- 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 parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this.parse = function (url, type, data, evt, xPath) {
- Create a ticketCreate a ticket
Function Test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var Test = function (fsWrapper, glob, mainDir, utils, cases_dir) {
- Create a ticketCreate a ticket