Showing 146 of 158 total issues
Function truncate
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
public static function truncate($text, $length = 100, $options = array())
{
$defaults = array(
'ellipsis' => '...', 'exact' => true, 'html' => 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
File Hash.php
has 679 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
File StringUtility.php
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* String handling methods.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
Function tokenize
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public static function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')')
{
if (empty($data)) {
return 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
File Inflector.php
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
ModelEntity
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class ModelEntity
{
use StrataObjectTrait;
/**
StrataContext
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class StrataContext
{
static $reference;
/**
Function saveWPGettextFunctions
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function saveWPGettextFunctions(array $functions, Translations $translations, $file = '')
{
foreach ($this->getFunctions() as $function) {
list($name, $line, $args) = $function;
- 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 setCurrentLocaleByContext
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function setCurrentLocaleByContext()
{
if (function_exists('apply_filters')) {
// Give a chance for plugins to override this decision
$locale = null;
- 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
i18n
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class i18n
{
/**
* @var string The default text domain used buy the class
*/
Function _matches
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected static function _matches(array $data, $selector)
{
preg_match_all(
'/(\[ (?P<attr>[^=><!]+?) (\s* (?P<op>[><!]?[=]|[><]) \s* (?P<val>(?:\/.*?\/ | [^\]]+)) )? \])/x',
$selector,
- 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 truncate
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncate($text, $length = 100, $options = array())
{
$defaults = array(
'ellipsis' => '...', 'exact' => true, 'html' => false
);
File I18n.php
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Strata\I18n;
use Strata\Strata;
Function uuid
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function uuid()
{
$node = getenv('SERVER_ADDR');
if (strpos($node, ':') !== false) {
if (substr_count($node, '::')) {
- 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
Query
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Query
{
/**
* A list of WP_Query filters. Defaults to a list of published posts
* ordered by name alphabetically unpaged.
Hash
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Hash
{
/**
* Get a single value specified by $path out of $data.
Function combine
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function combine(array $data, $keyPath, $valuePath = null, $groupPath = null)
{
if (empty($data)) {
return 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
Function extract
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function extract(array $data, $path)
{
if (empty($path)) {
return $data;
}
- 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 scanThemeDirectories
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function scanThemeDirectories($base)
{
$tree = array("themes" => array());
$di = new \RecursiveDirectoryIterator($base);
- 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 _simpleOp
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected static function _simpleOp($op, $data, $path, $values = null)
{
$_list =& $data;
$count = count($path);
- 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"