Function listModules
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
static public function listModules($base_class, $include_base=false, $debug=false)
{
// leading backslash is ignored
if ($base_class[0] == '\\') {
$base_class = substr($base_class, 1);
- 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 FannieAPI.php
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
Method listModules
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function listModules($base_class, $include_base=false, $debug=false)
{
// leading backslash is ignored
if ($base_class[0] == '\\') {
$base_class = substr($base_class, 1);
Method searchDirectories
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
static private function searchDirectories($base_class)
{
$directories = array();
// prefer directories from Poser if present
$poser = FannieConfig::config('POSER');
Function findClass
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
static private function findClass($name, $path)
{
if (!is_dir($path)) {
return false;
} else if ($name == 'index') {
- 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 loadClass
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
static public function loadClass($name)
{
$session = self::session();
$map = isset($session->FannieClassMap) ? $session->FannieClassMap : 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 searchDirectories
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
static private function searchDirectories($base_class)
{
$directories = array();
// prefer directories from Poser if present
$poser = FannieConfig::config('POSER');
- 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 loadClass
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function loadClass($name)
{
$session = self::session();
$map = isset($session->FannieClassMap) ? $session->FannieClassMap : array();
Function pathToClass
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function pathToClass($path)
{
$name = false;
$basedir = 'unknown';
$path = realpath($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"
Further reading
Method findClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static private function findClass($name, $path)
{
if (!is_dir($path)) {
return false;
} else if ($name == 'index') {
Function listFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static public function listFiles($path)
{
if (is_file($path) && substr($path,-4)=='.php') {
return array($path);
} elseif (is_dir($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"
Further reading
Function loadFromNamespace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static private function loadFromNamespace($class)
{
$namespaces = array(
'COREPOS\\common\\' => dirname(__FILE__) . '/../../common/',
'COREPOS\\Fannie\\API\\' => dirname(__FILE__) . '/',
- 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
Avoid too many return
statements within this method. Open
return $files;
Avoid too many return
statements within this method. Open
return $ret;