Showing 158 of 158 total issues
Function merge
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function merge(array $data, $merge)
{
$args = array_slice(func_get_args(), 1);
$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 contains
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function contains(array $data, array $needle)
{
if (empty($data) || empty($needle)) {
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
Method exportObject
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function exportObject($var, $depth = 1, $indent = 0)
{
$out = '';
$props = [];
$className = get_class($var);
Method _matches
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function _matches(array $data, $selector)
{
preg_match_all(
'/(\[ (?P<attr>[^=><!]+?) (\s* (?P<op>[><!]?[=]|[><]) \s* (?P<val>(?:\/.*?\/ | [^\]]+)) )? \])/x',
$selector,
Method scanThemeDirectories
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function scanThemeDirectories($base)
{
$tree = array("themes" => array());
$di = new \RecursiveDirectoryIterator($base);
Method register
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function register()
{
// Ensure the default options have been set.
$customizedOptions = $this->model->getConfiguration() + array(
'labels' => array(),
Function save
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if ($this->isBound()) {
if (!isset($this->post_type)) {
- 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 singularize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function singularize($word)
{
if (isset(self::$_cache['singularize'][$word])) {
return self::$_cache['singularize'][$word];
}
Function exportObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function exportObject($var, $depth = 1, $indent = 0)
{
$out = '';
$props = [];
$className = get_class($var);
- 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 rrmdir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function rrmdir($dir)
{
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
- 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 get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function get(array $data, $path, $default = null)
{
if (empty($data) || $path === '' || $path === null) {
return $default;
}
- 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 extract
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function extract(array $data, $path)
{
if (empty($path)) {
return $data;
}
Method trace
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function trace($backtrace = null, $options = array())
{
if (is_null($backtrace)) {
$backtrace = debug_backtrace();
}
Method writeThemesDocumentation
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeThemesDocumentation($info)
{
$header = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>Overview</title>';
$header .= '<link rel="stylesheet" href="../api/resources/style.css">';
$header .= '</head><body><div id="content">';
Method rules
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function rules($type, $rules, $reset = false)
{
$var = '_' . $type;
switch ($type) {
Method wordWrap
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function wordWrap($text, $width = 72, $break = "\n", $cut = false)
{
if ($cut) {
$parts = array();
while (mb_strlen($text) > 0) {
Method expand
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function expand($data, $separator = '.')
{
$result = array();
$stack = array();
Function addResourcePossibility
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function addResourcePossibility(WordpressEntity $model)
{
$slug = null;
if (property_exists($model, "routed") && is_array($model->routed) && array_key_exists("controller", $model->routed)) {
- 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 relationsToQueries
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function relationsToQueries()
{
foreach ($this->filters['strata_relations'] as $queryType => $queryDetails) {
// At this point, there should only be exclusive AND or OR query groups
$metaQueries = 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
Function trace
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function trace($backtrace = null, $options = array())
{
if (is_null($backtrace)) {
$backtrace = debug_backtrace();
}
- 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"