pulsarvp/vps-tools

View on GitHub

Showing 201 of 201 total issues

Function getHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function getHeader ($name)
        {
            if (is_array($this->_headers))
            {
                foreach ($this->_headers as $header)
Severity: Minor
Found in src/net/CurlResponse.php - About 25 mins to fix

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 setActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private function setActive ()
        {
            foreach ($this->_data as $type => $list)
            {
                foreach ($list as $menu)
Severity: Minor
Found in src/modules/menu/components/MenuManager.php - About 25 mins to fix

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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function save ($tmpname, $path = null, $returnRelative = true)
        {
            $ext = pathinfo($tmpname, PATHINFO_EXTENSION);
            $name = UuidHelper::generate();
            if ($ext)
Severity: Minor
Found in src/components/FileManager.php - About 25 mins to fix

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 actionController has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function actionController ($name = null)
        {
            if (is_null($name))
                $name = [ 'api', 'frontend', 'backend', 'console' ];
            else
Severity: Minor
Found in src/controllers/ConfigController.php - About 25 mins to fix

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 beforeSave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function beforeSave ($insert)
        {
            if (parent::beforeSave($insert))
            {
                if ($this->isNewRecord)
Severity: Minor
Found in src/modules/page/models/Page.php - About 25 mins to fix

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 listFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function listFiles ($path, $absolute = false)
        {
            if (is_dir($path) and is_readable($path))
            {
                $data = [];
Severity: Minor
Found in src/helpers/FileHelper.php - About 25 mins to fix

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 maxBytesUpload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function maxBytesUpload ()
        {
            $values = [
                ini_get('post_max_size'),
                ini_get('upload_max_filesize'),
Severity: Minor
Found in src/helpers/HumanHelper.php - About 25 mins to fix

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 objectsAttributeRecursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function objectsAttributeRecursive ($objects, $attribute, $children = 'children')
        {
            if (!is_array($objects))
                return null;

Severity: Minor
Found in src/helpers/ArrayHelper.php - About 25 mins to fix

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 countItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function countItems ($path)
        {
            if (is_dir($path) and ( $dir = opendir($path) ) !== false)
            {
                $return = self::countItemsInDir($path);
Severity: Minor
Found in src/helpers/FileHelper.php - About 25 mins to fix

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 offsets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function offsets ($message)
        {
            try
            {
                if (isset($message[ 'topic' ]))
Severity: Minor
Found in src/components/KafkaRest.php - About 25 mins to fix

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 table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function table ($head, $body, $options = [])
        {
            $table = self::beginTag('table', $options);

            if (!empty($head) and is_array($head))
Severity: Minor
Found in src/helpers/Html.php - About 25 mins to fix

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 actionInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function actionInfo ($name = null)
        {

            if (is_null($name))
                $name = [ 'api', 'frontend', 'backend', 'console' ];
Severity: Minor
Found in src/controllers/ConfigController.php - About 25 mins to fix

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 listDirs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function listDirs ($path, $absolute = false)
        {
            if (is_dir($path) and is_readable($path))
            {
                $data = [];
Severity: Minor
Found in src/helpers/FileHelper.php - About 25 mins to fix

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 actionView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function actionView ($id)
        {
            $this->_tpl = '@userViews/index';
            $userClass = $this->module->modelUser;
            $user = $userClass::findOne($id);
Severity: Minor
Found in src/modules/user/controllers/UserController.php - About 25 mins to fix

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 findOrCreate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function findOrCreate ($condition, $attributes = null)
        {
            $model = static::find()->where($condition)->one();
            if ($model == null)
            {
Severity: Minor
Found in src/base/BaseModel.php - About 25 mins to fix

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 listRelativeFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function listRelativeFiles ($path, $relativepath)
        {
            if (is_dir($path) and is_readable($path))
            {
                $data = [];
Severity: Minor
Found in src/helpers/FileHelper.php - About 25 mins to fix

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 duration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function duration ($duration)
        {
            if (is_numeric($duration))
            {
                $negative = ( $duration < 0 );
Severity: Minor
Found in src/helpers/HumanHelper.php - About 25 mins to fix

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 actionUserRole has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function actionUserRole ()
        {
            $userClass = $this->module->modelUser;
            $post = Yii::$app->request->post();
            $user = $userClass::findOne($post[ 'id' ]);
Severity: Minor
Found in src/modules/user/controllers/RbacController.php - About 25 mins to fix

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 buildPaths has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        protected function buildPaths ()
        {
            $titles = [];
            $guids = [];

Severity: Minor
Found in src/components/CategoryManager.php - About 25 mins to fix

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 getParents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function getParents ($category)
        {
            if ($category instanceof $this->_modelClass)
            {
                $parents = [];
Severity: Minor
Found in src/components/CategoryManager.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language