dmitry-kulikov/yii2-json-editor

View on GitHub
src/assets/JsonEditorAsset.php

Summary

Maintainability
A
45 mins
Test Coverage
A
100%

Function init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function init()
    {
        if (empty($this->css)) {
            if (YII_ENV_DEV) {
                $this->css = $this->cssDev;
Severity: Minor
Found in src/assets/JsonEditorAsset.php - About 45 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

Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->jsProd
Wontfix

    public $jsProd;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Possibly zero references to public property \kdn\yii2\assets\JsonEditorAsset->sourcePath
Wontfix

    public $sourcePath = '@npm/jsoneditor/dist';
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->cssDev
Wontfix

    public $cssDev = [
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->cssProd
Wontfix

    public $cssProd = [
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->jsDev
Wontfix

    public $jsDev;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix

                $this->js = $this->jsProd;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Class extends undeclared class \yii\web\AssetBundle
Wontfix

abstract class JsonEditorAsset extends AssetBundle
Severity: Critical
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix

                $this->css = $this->cssDev;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix

                $this->css = $this->cssProd;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix

        if (empty($this->js)) {
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix

                $this->js = $this->jsDev;
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared constant \YII_ENV_DEV
Wontfix

            if (YII_ENV_DEV) {
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared class \yii\web\AssetBundle
Wontfix

        parent::init();
Severity: Critical
Found in src/assets/JsonEditorAsset.php by phan

Possibly zero references to public method \kdn\yii2\assets\JsonEditorAsset::init()
Wontfix

    public function init()
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix

        if (empty($this->css)) {
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

Reference to undeclared constant \YII_ENV_DEV
Wontfix

            if (YII_ENV_DEV) {
Severity: Minor
Found in src/assets/JsonEditorAsset.php by phan

There are no issues that match your filters.

Category
Status