Showing 224 of 370 total issues
File search.js
has 706 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var _ = require('underscore'),
Model = require('model'),
Dragula = require('dragula'),
Function search
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
public function search($date, $settings, $query_list, $fields, $date_field, $date_type, $result_type, $filter_range) {
// If we're looking for no results, set filter to (< 1)
if($result_type == self::R_NO_RESULTS) {
$filter_range = [0, 0];
}
- Read upRead up
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 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
app: {
File util.js
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var $ = require('jquery'),
_ = require('underscore'),
URI = require('uri'),
File ESClient.php
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace FOO;
/**
File alerts.js
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var $ = require('jquery'),
_ = require('underscore'),
View = require('view'),
File alertgroup.js
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var _ = require('underscore'),
View = require('view'),
TableView = require('views/table'),
File actions.js
has 425 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var _ = require('underscore'),
View = require('view'),
ModalView = require('views/modal'),
File Model.php
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace FOO;
/**
Function update
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function update($get, $data, $set_fields=[]) {
if(!$this->allowUpdate()) {
throw new ForbiddenException;
}
$id = Util::get($get, 'id');
- Read upRead up
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 processSite
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function processSite($site, $date) {
$base_title = sprintf('411] Time: %d Site: %d', $date, $site['id']);
cli_set_process_title($base_title);
print "[+] Worker: $date\n";
$timer = new Timer();
- Read upRead up
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 token
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
function token(stream, state) {
var ch = stream.peek();
// Errors are terminal!
if(state.error) {
File app.js
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
File alert.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var _ = require('underscore'),
View = require('view'),
ModelView = require('views/model'),
Method search
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($date, $settings, $query_list, $fields, $date_field, $date_type, $result_type, $filter_range) {
// If we're looking for no results, set filter to (< 1)
if($result_type == self::R_NO_RESULTS) {
$filter_range = [0, 0];
}
Function setAlertFields
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function setAlertFields($data, $fields, $alog_action, $slog_action, $a=0, $b=0) {
if(!$this->allowUpdate()) {
throw new ForbiddenException;
}
- Read upRead up
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 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
QueryParser.prototype._parse = function(tokens) {
var ret = {};
var stk = 0;
var node = ret;
var node = {};
Function _run
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function _run($commit, Search $search, $disable_search_commit=false) {
$alerts = [];
$errors = [];
// Don't allow saving Alerts if the Search isn't in the DB.
- Read upRead up
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 searches.js
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
define(function(require) {
var $ = require('jquery'),
_ = require('underscore'),
View = require('view'),
Method update
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($get, $data, $set_fields=[]) {
if(!$this->allowUpdate()) {
throw new ForbiddenException;
}
$id = Util::get($get, 'id');