Showing 224 of 370 total issues
Function getClient
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getClient($config_name='alerts', $index=false) {
$escfg = Config::get('elasticsearch')[$config_name];
$cb = \Elasticsearch\ClientBuilder::create();
if($index && count($escfg['index_hosts']) > 0) {
$cb->setHosts($escfg['index_hosts']);
- 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 initAssigneeSelect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var initAssigneeSelect = function(elems, users, groups, search, options) {
Function loadCollectionsAndModel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
loadCollectionsAndModel: function(collections, collection, id, func, deferred) {
Method generateClauses
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected static function generateClauses($count=null, $offset=null, $sort=[], $group=[], $reverse=null) {
Method getByQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getByQuery(array $query=[], $count=null, $offset=null, $sort=[], $reverse=null) {
Method countByQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function countByQuery(array $query=[], $count=null, $offset=null, $sort=[], $reverse=null) {
Method getAlerts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAlerts($query, $from, $to, $offset, $count) {
Method sendAlertEmail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function sendAlertEmail($to, $search, $alerts, $content_only, $debug_data=[]) {
Method mail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function mail($to, $from, $title, $message, $file=null) {
Function generateSearchTimeBased
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function generateSearchTimeBased() {
$time_based = [];
if(Auth::isAuthenticated()) {
foreach(Search::getTypes() as $type) {
if($type::$SOURCES) {
- 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 GET
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function GET(array $get) {
$data = [];
$meta = new DBMeta;
$cfg = new DBConfig;
$client = new ESClient;
- 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 delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function delete($hard=false) {
if($this->new) {
return false;
}
- 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 getSearchHealth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchHealth() {
$search_health = [];
foreach(Search::getTypes() as $MODEL) {
$sources = $MODEL::getSources();
if(is_null($sources)) {
- 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 POST
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function POST(array $get, array $data) {
$ret = null;
$name = Util::get($data, 'name');
$pass = Util::get($data, 'password');
if($name && $pass) {
- 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 init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function init() {
$user = null;
$auth_config = Config::get('auth');
$api_auth = Util::get($auth_config['api'], 'enabled', false);
$proxy_auth = Util::get($auth_config['proxy'], 'enabled', false);
- 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 read
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function read($data) {
if(!$this->allowRead()) {
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 test
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function test($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 filterByKeys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function filterByKeys($keys, $srcs) {
$ret = [];
foreach($keys as $key) {
foreach($srcs as $src) {
if(Util::exists($src, $key)) {
- 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 _execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _execute($date, $constructed_qdata) {
$tecfg = $this->getConfig();
if(is_null($tecfg['api_token']) || is_null($tecfg['api_secret'])) {
throw new SearchException('Threatexchange not configured');
}
- 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 generateClause
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function generateClause($key, $value) {
$val_cmp = true;
$conds = [];
$vals = [];
- 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"