assetManager
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class assetManager
{
/**
* @var assetManager
- Create a ticketCreate a ticket
File assetManager.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CMSFactory;
use CI;
- Create a ticketCreate a ticket
Function _render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function _render($tpl, $ignoreWrap = FALSE, $fetchJsTpl = TRUE, $admin = FALSE) {
if (CI_Controller::get_instance()->input->is_ajax_request()) {
$ignoreWrap = TRUE;
}
if (CI_Controller::get_instance()->input->post('ignoreWrap')) {
- Read upRead up
- Create a ticketCreate a ticket
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 getModuleFilePath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getModuleFilePath($files, $noExt = true) {
if (is_string($files)) {
$files = [$files];
}
- Read upRead up
- Create a ticketCreate a ticket
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 _render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _render($tpl, $ignoreWrap = FALSE, $fetchJsTpl = TRUE, $admin = FALSE) {
if (CI_Controller::get_instance()->input->is_ajax_request()) {
$ignoreWrap = TRUE;
}
if (CI_Controller::get_instance()->input->post('ignoreWrap')) {
- Create a ticketCreate a ticket
Function makePath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function makePath($path) {
$path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
$startSlash = strpos($path, '/') === 0 ? '/' : '';
- Read upRead up
- Create a ticketCreate a ticket
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 registerStyle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function registerStyle($name, $useCompress = FALSE) {
/** Start. Load file into template */
$path = $this->buildStylePath($name);
if ('' !== $path) {
- Read upRead up
- Create a ticketCreate a ticket
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 false;
- Create a ticketCreate a ticket