Showing 224 of 370 total issues
Function process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function process() {
Logger::info('Worker run', [], self::LOG_NAMESPACE);
cli_set_process_title('411] Worker');
print "[+] Worker\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 loadMoreAlerts
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadMoreAlerts: function(e) {
var elem = $(e.currentTarget).closest('.alerts-load').find('input').get(0);
var n = parseInt(elem.value, 10);
var data = {
Function _render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_render: function() {
NavbarView.prototype._render.call(this);
var default_search = this.App.Data.User.get('settings')['default'];
var query = Util.parseQuery(window.location.href);
Function readForm
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
readForm: function() {
var data = SearchView.SearchView.prototype.readForm.call(this);
if("result_type" in data) {
data.query_data.result_type = parseInt(data.result_type, 10);
Function processResults
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processResults = this.cbRendered(function(resp) {
this.collections = [];
for(var i = 0; i < resp.length; ++i) {
var c = resp[i].count;
Function save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function(data, options) {
if(_.isUndefined(data)) {
data = [];
for(var k in this.models) {
var attrs = this.models[k].toJSON();
Method POST
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function POST(array $get, array $data) {
$cfg = new DBConfig();
foreach(self::$FIELDS as $field=>$type) {
$val = Util::get($data, $field);
Method constructQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function constructQuery() {
$query = Util::get($this->obj['query_data'], 'query');
$fields = Util::get($this->obj['query_data'], 'fields', []);
$parser = new \ESQuery\Parser;
list($settings, $query_list) = $parser->parse($query);
Function autoProcess
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Renderer.autoProcess = function(App, in_mapping, callback) {
// Rank all renderers to determine whether they should run.
var out_mapping = {};
// First loop over each group of views.
Function parseKeyStr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseKeyStr: function(keyStr) {
var tkeys = [];
var keys = keyStr.split('+');
for(var i = 0; i < keys.length; ++i) {
var tkey = keys[i];
Function beforeRoute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
beforeRoute: function(route) {
if(this.View.Current) {
var val = this.View.Current.onExit();
// onExit returned false, deny.
var deny = _.isBoolean(val) && !val;
Function initSearchSelect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initSearchSelect = function(elems, searches, search, options) {
options = options || {};
var search_search = function(q) {
var term = q.term.toLowerCase();
Method read
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read($data) {
if(!$this->allowRead()) {
throw new ForbiddenException;
}
Method test
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test($get, $data) {
if(!$this->allowCreate()) {
throw new ForbiddenException;
}
Method GET
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GET(array $get) {
$jira_data = [
'Issues' => [],
'Users' => [],
];
Method search
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function search($date, $settings, $query_list, $fields, $date_field, $date_type, $result_type, $filter_range) {
Method sendRollupEmail
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function sendRollupEmail($to, $new_alerts, $actions, $searches, $action_alerts, $active_alerts, $content_only=false, $debug_data=[]) {
Function GET
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function GET(array $get) {
$jira_data = [
'Issues' => [],
'Users' => [],
];
- 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 preview
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function preview($get, $data) {
if(!$this->allowCreate()) {
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 getTypes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getTypes() {
static $type_map = null;
if(is_null($type_map)) {
$type_map = [];
// Populate the list of types.
- 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"