Showing 1,330 of 2,467 total issues
Function publish
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function publish($am)
{
if ($this->sourcePath !== null && !isset($this->basePath, $this->baseUrl)) {
list($this->basePath, $this->baseUrl) = $am->publish($this->sourcePath, $this->publishOptions);
}
- 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 parseRequest
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function parseRequest($manager, $request)
{
if ($this->mode === self::CREATION_ONLY) {
return false;
}
- 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 loadCookies
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function loadCookies()
{
$cookies = [];
if ($this->enableCookieValidation) {
if ($this->cookieValidationKey == '') {
- 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 translatePattern
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function translatePattern($allowAppendSlash)
{
$tr = [
'.' => '\\.',
'*' => '\\*',
- 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 trigger
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function trigger($class, $name, $event = null)
{
$wildcardEventHandlers = [];
foreach (self::$_eventWildcards as $nameWildcard => $classHandlers) {
if (!StringHelper::matchWildcard($nameWildcard, $name)) {
- 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 hasHandlers
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function hasHandlers($class, $name)
{
if (empty(self::$_eventWildcards) && empty(self::$_events[$name])) {
return false;
}
- 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 getHeaders
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getHeaders()
{
if ($this->_headers === null) {
$this->_headers = new HeaderCollection();
if (function_exists('getallheaders')) {
- 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
The class Container has an overall complexity of 123 which is very high. The configured complexity threshold is 50. Open
class Container extends Component
{
/**
* @var array singleton objects indexed by their types
*/
- Exclude checks
The class Controller has an overall complexity of 109 which is very high. The configured complexity threshold is 50. Open
class Controller extends \yii\base\Controller
{
/**
* @deprecated since 2.0.13. Use [[ExitCode::OK]] instead.
*/
- Exclude checks
The class BaseMigrateController has 11 public methods. Consider refactoring BaseMigrateController to keep number of public methods under 10. Open
abstract class BaseMigrateController extends Controller
{
/**
* The name of the dummy migration that marks the beginning of the whole migration history.
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class PhpManager has 16 public methods. Consider refactoring PhpManager to keep number of public methods under 10. Open
class PhpManager extends BaseManager
{
/**
* @var string the path of the PHP script that contains the authorization items.
* This can be either a file path or a [path alias](guide:concept-aliases) to the file.
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class PhpManager has 31 non-getter- and setter-methods. Consider refactoring PhpManager to keep number of methods under 25. Open
class PhpManager extends BaseManager
{
/**
* @var string the path of the PHP script that contains the authorization items.
* This can be either a file path or a [path alias](guide:concept-aliases) to the file.
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class Controller has 11 public methods. Consider refactoring Controller to keep number of public methods under 10. Open
class Controller extends \yii\base\Controller
{
/**
* @deprecated since 2.0.13. Use [[ExitCode::OK]] instead.
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class BaseMigrateController has an overall complexity of 154 which is very high. The configured complexity threshold is 50. Open
abstract class BaseMigrateController extends Controller
{
/**
* The name of the dummy migration that marks the beginning of the whole migration history.
*/
- Exclude checks
The class Table has an overall complexity of 54 which is very high. The configured complexity threshold is 50. Open
class Table extends Widget
{
const DEFAULT_CONSOLE_SCREEN_WIDTH = 120;
const CONSOLE_SCROLLBAR_OFFSET = 3;
const CHAR_TOP = 'top';
- Exclude checks
The class FixtureController has an overall complexity of 56 which is very high. The configured complexity threshold is 50. Open
class FixtureController extends Controller
{
use FixtureTrait;
/**
- Exclude checks
The class MigrateController has an overall complexity of 68 which is very high. The configured complexity threshold is 50. Open
class MigrateController extends BaseMigrateController
{
/**
* Maximum length of a migration name.
* @since 2.0.13
- Exclude checks
The class AssetController has an overall complexity of 115 which is very high. The configured complexity threshold is 50. Open
class AssetController extends Controller
{
/**
* @var string controller default action ID.
*/
- Exclude checks
The class HelpController has an overall complexity of 95 which is very high. The configured complexity threshold is 50. Open
class HelpController extends Controller
{
/**
* Displays available commands or the detailed information
* about a particular command.
- Exclude checks
The class Cache has an overall complexity of 68 which is very high. The configured complexity threshold is 50. Open
abstract class Cache extends Component implements CacheInterface
{
/**
* @var string a string prefixed to every cache key so that it is unique globally in the whole cache storage.
* It is recommended that you set a unique cache key prefix for each application if the same cache
- Exclude checks