Showing 11 of 11 total issues
Function get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get(){
$aArgs = func_get_args();
$aResult = null;
foreach($aArgs as $sArg){
- 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 addToAssetManager
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function addToAssetManager($aAssets){
// Build asset array
foreach($aAssets as $sName => $aAssetGroup){
foreach($aAssetGroup as $sType => $aFiles){
- 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 getDirectories
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getDirectories($sDirectory, $bWithPath = true){
$aDirs = array();
if(!is_dir($sDirectory)){
return $aDirs;
- 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 getFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getFiles($sDirectory, $sExt = '')
{
$aFiles = array();
if(!is_dir($sDirectory)){
- 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 setRootPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function setRootPath(){
if(!isset($this->_aConfig['crispus']['paths']['root'])){
/* Vendor directory is in the root, step up until we find vendor
* Limit to 10 levels. */
$sCurDir = __DIR__;
- 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 getJSONError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getJSONError($iError){
switch ($iError) {
case JSON_ERROR_NONE:
return 'Success';
break;
- 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 getAllPagesInDir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getAllPagesInDir($sPath, $sUrl, $sGlobalConfigFile){
$oConfig = new SiteConfig($sGlobalConfigFile);
$sSortKey = $oConfig->get('site', 'menu', 'sort_by');
$bAsc = (bool)$oConfig->get('site', 'menu', 'sort_asc');
- 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 'Syntax error, malformed JSON';
Avoid too many return
statements within this method. Open
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
Avoid too many return
statements within this method. Open
return 'Unknown error';
Function setPageConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setPageConfig($aConfig) {
if(is_array($aConfig)){
if(is_array($aConfig)){
$this->aPageConfig = array_change_key_case($aConfig, CASE_LOWER);
}else{
- 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"