Showing 224 of 370 total issues
Method generateQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function generateQuery(array $fields, array $query=[], $count=null, $offset=null, $sort=[], $group=[], $reverse=null) {
Method backtrace
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function backtrace($label, $desc, $file, $line, $bt=null, $skip=0, $ns='NONE') {
Method sendSummaryEmail
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function sendSummaryEmail($to, $start_date, $stats, $leaders, $noisy_searches, $quiet_searches, $debug_data=[]) {
Method query
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function query($query, $fields=null, $from=null, $to=null, $scroll=false, $offset=null, $count=null) {
Method setAlertFields
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function setAlertFields($data, $fields, $alog_action, $slog_action, $a=0, $b=0) {
Avoid deeply nested control flow statements. Open
if(!(k in final_ret)) {
final_ret[k] = [];
}
Method entry
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function entry($type, $action, $target=0, $actor=0, $a=0, $b=0) {
Function processTargets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function processTargets(array $alerts, array $targets, $date) {
$errors = [];
foreach($targets as $target) {
// Call process on each Target -> Alert.
foreach($alerts as $alert) {
- 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 getAssigneeName
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
var getAssigneeName = function(assignee_type, assignee, users, groups, def_ret, prefix) {
Avoid deeply nested control flow statements. Open
for(var m in searches) {
// Active
var states = searches[m];
for(var n in states) {
var collection = states[n];
Function deserialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Renderer.deserialize = function(App, mapping, model_id, in_mapping, callback, preview) {
Function sendAlerts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function sendAlerts($data) {
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 whitelistAlerts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function whitelistAlerts($data) {
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
Avoid deeply nested control flow statements. Open
if(vtok.length === 0) {
throw new ParseException('Empty group: "' + ktok + '"');
}
Function processFilters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function processFilters(array $alerts, array $filters, $date) {
$errors = [];
foreach($filters as $filter) {
$new_alerts = [];
- 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 constructQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function constructQuery() {
$query = Util::get($this->obj['query_data'], 'query', '');
$range = Util::get($this->obj['query_data'], 'range', 10);
$type = Util::get($this->obj['query_data'], 'type', '');
- 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
Method sendAlertActionEmail
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function sendAlertActionEmail($to, $action, $searches, $alerts, $content_only=false, $debug_data=[]) {
Function getEmails
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getEmails($type, $entry, $update=true, $all=false) {
$emails = [];
switch($type) {
case self::T_USER:
$user = UserFinder::getById($entry);
- 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 processSearches
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function processSearches($date, $search_health, $backfill) {
foreach(SearchFinder::getByQuery(['enabled' => 1]) as $search) {
// If the search doesn't need to run OR
// the search type is failing and isn't time based
// skip it!
- 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 sendAlertEmail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function sendAlertEmail($to, $search, $alerts, $content_only, $debug_data=[]) {
$alertkeys = [];
$long = false;
foreach($alerts as $alert) {
if(count($alert['content']) >= 10) {
- 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"