Showing 224 of 370 total issues
Avoid too many return
statements within this function. Open
return token_string(stream, state);
Avoid too many return
statements within this function. Open
return token_error(stream, state);
Avoid too many return
statements within this method. Open
return self::format($this->read($get));
Avoid too many return
statements within this function. Open
return token_(state, "builtin");
Avoid too many return
statements within this function. Open
return token_(state, "variable-2");
Avoid too many return
statements within this function. Open
return tokenize(stream, state);
Avoid too many return
statements within this function. Open
return words.hasOwnProperty(cur) ? words[cur] : null;
Avoid too many return
statements within this function. Open
return token_(state, "punctuation");
Avoid too many return
statements within this function. Open
return 'attribute';
Avoid too many return
statements within this function. Open
return "operator";
Avoid too many return
statements within this method. Open
return;
Function process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function process(Alert $alert, $date) {
$data = $this->obj['data'];
$key_regex = Util::get($data, 'key_regex', '');
$expression = Util::get($data, 'value_expr', '');
$keys = array_keys($alert['content']);
- 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 toArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function toArray(array $keys=null) {
$ret = [];
if(is_null($keys)) {
$keys = array_keys($this->obj);
} else {
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function process(Alert $alert, $date) {
$data = $this->obj['data'];
$key_regex = Util::get($data, 'key_regex', '');
$expression = Util::get($data, 'key_expr', '');
$keys = array_keys($alert['content']);
- 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 PUT
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function PUT(array $get, array $data) {
$target_id = (int) Util::get($get, 'id');
// Only an admin user or the user themself should be able to modify a user!
// That check is done here. Note that the strict compare is necessary as getUserId()
// can return null.
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute($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 prompt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function prompt($str) {
$ret = '';
while(true) {
printf("%s: ", $str);
$ret = fgets(STDIN);
- 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 isWorking
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function isWorking($date) {
$cfg = $this->getConfig();
$client = ESClient::getClient($this->getClientConfigKey());
$working = 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 constructQuery
has a Cognitive Complexity of 6 (exceeds 5 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);
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function processSite($site, $date, $backfill) {
Logger::info('Process site', ['id' => $site['id'], 'date' => $date, 'backfill' => $backfill], self::LOG_NAMESPACE);
$base_title = sprintf('411] Time: %d Site: %d', $date, $site['id']);
cli_set_process_title($base_title);
$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"