src/assets/JsonEditorAsset.php
Function init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function init()
{
if (empty($this->css)) {
if (YII_ENV_DEV) {
$this->css = $this->cssDev;
- 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
Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->jsProd
Wontfix
Wontfix
public $jsProd;
- Exclude checks
Possibly zero references to public property \kdn\yii2\assets\JsonEditorAsset->sourcePath
Wontfix
Wontfix
public $sourcePath = '@npm/jsoneditor/dist';
- Exclude checks
Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->cssDev
Wontfix
Wontfix
public $cssDev = [
- Exclude checks
Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->cssProd
Wontfix
Wontfix
public $cssProd = [
- Exclude checks
Possibly zero write references to public property \kdn\yii2\assets\JsonEditorAsset->jsDev
Wontfix
Wontfix
public $jsDev;
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix
Wontfix
$this->js = $this->jsProd;
- Exclude checks
Class extends undeclared class \yii\web\AssetBundle
Wontfix
Wontfix
abstract class JsonEditorAsset extends AssetBundle
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix
Wontfix
$this->css = $this->cssDev;
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix
Wontfix
$this->css = $this->cssProd;
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix
Wontfix
if (empty($this->js)) {
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->js
Wontfix
Wontfix
$this->js = $this->jsDev;
- Exclude checks
Reference to undeclared constant \YII_ENV_DEV
Wontfix
Wontfix
if (YII_ENV_DEV) {
- Exclude checks
Reference to undeclared class \yii\web\AssetBundle
Wontfix
Wontfix
parent::init();
- Exclude checks
Possibly zero references to public method \kdn\yii2\assets\JsonEditorAsset::init()
Wontfix
Wontfix
public function init()
- Exclude checks
Reference to undeclared property \kdn\yii2\assets\JsonEditorAsset->css
Wontfix
Wontfix
if (empty($this->css)) {
- Exclude checks
Reference to undeclared constant \YII_ENV_DEV
Wontfix
Wontfix
if (YII_ENV_DEV) {
- Exclude checks