Function loadTVs
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
public function loadTVs($reloadData = array()) {
$this->setPlaceholder('wctx',$this->resource->get('context_key'));
$_GET['wctx'] = $this->resource->get('context_key');
$this->fireOnTVFormRender();
- 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 loadTVs
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadTVs($reloadData = array()) {
$this->setPlaceholder('wctx',$this->resource->get('context_key'));
$_GET['wctx'] = $this->resource->get('context_key');
$this->fireOnTVFormRender();
File resource.class.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
Function getInstance
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance(modX &$modx,$className,array $config = array()) {
$resourceClass = 'modDocument';
$isDerivative = false;
if (!empty($_REQUEST['class_key'])) {
$isDerivative = true;
- 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 getReloadData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function getReloadData() {
$modx =& $this->modx;
$scriptProperties =& $this->scriptProperties;
$reloadData = array();
- 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 getInstance
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getInstance(modX &$modx,$className,array $config = array()) {
$resourceClass = 'modDocument';
$isDerivative = false;
if (!empty($_REQUEST['class_key'])) {
$isDerivative = true;
Function getResourceGroups
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getResourceGroups() {
$parentGroups = array();
if ($this->resource->get('id') == 0) {
$parent = $this->modx->getObject('modResource',$this->resource->get('parent'));
/** @var modResource $parent */
- 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 getResourceGroups
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getResourceGroups() {
$parentGroups = array();
if ($this->resource->get('id') == 0) {
$parent = $this->modx->getObject('modResource',$this->resource->get('parent'));
/** @var modResource $parent */