Showing 331 of 503 total issues
Function setRelation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function setRelation(array $value, $viaTableName, $localTableId, $foreignTableId, $activeRecordId)
{
Yii::$app->db->createCommand()->delete($viaTableName, [$localTableId => $activeRecordId])->execute();
$batch = [];
foreach ($value as $k => $v) {
- 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 checkInputLabels
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var checkInputLabels = function () {
var $loginInput = $('.login-input');
var check = function($element) {
var val = $element.val() ? $element.val() : '';
- 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 evalGroupFields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function evalGroupFields($pointerElements)
{
$groups = [];
if (!$pointerElements) {
return [];
- 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 sessionBruteForceLock
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function sessionBruteForceLock($userId)
{
if (empty($userId)) {
// block all request from this IP
$userId = 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 remove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function remove($key)
{
$lastArray = [];
if ($this->has($key)) {
$array = &$this->data;
- 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 itemPoolApi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function itemPoolApi($name, $route, $icon, $apiEndpoint, $pool, array $options = [])
Function actionFilesUpload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function actionFilesUpload()
{
foreach ($_FILES as $k => $file) {
if ($file['error'] !== UPLOAD_ERR_OK) {
Yii::$app->response->setStatusCode(422, 'Data Validation Failed.');
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$ids = [];
foreach ($this->getImporter()->getDirectoryFiles('properties') as $file) {
- 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 removeImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function removeImage($imageId, $cleanup = false)
{
Yii::$app->storage->flushArrays();
$image = Yii::$app->storage->getImage($imageId);
if ($cleanup && $image) {
- 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 actionUser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function actionUser()
{
while (true) {
$email = $this->prompt('User Email:');
if (!empty(User::findByEmail($email))) {
- 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 getLongDescription
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getLongDescription()
{
$content = [];
foreach ($this->rows['texts'] as $key => $row) {
if ($key == 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 addPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addPath(BasePathParser $pathParser)
{
if ($pathParser->isValid()) {
if (!empty($this->filterPaths)) {
if (StringHelper::filterMatch($pathParser->getPath(), $this->filterPaths)) {
- 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 getClassName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getClassName()
{
if ($this->_className !== null) {
return $this->_className;
}
- 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 setRelation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function setRelation(array $value, $viaTableName, $localTableId, $foreignTableId, $activeRecordId)
Method createPluginObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function createPluginObject($className, $name, $alias, $i18n, $args = [])
Function addAndswitchToTab
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$scope.addAndswitchToTab = function(pk, route, index, label, model) {
Method actionIndex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function actionIndex($inline = false, $relation = false, $arrayIndex = false, $modelClass = false, $modelSelection = false)
Function addTab
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
service.addTab = function(id, api, arrayIndex, name, modelClass) {
Method itemApi
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function itemApi($name, $route, $icon, $apiEndpoint, array $options = [])
Method asyncRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function asyncRequest($ngModel, $label, $api, $fields, array $options = [])