Showing 651 of 651 total issues
Method name "Modules::parse_routes" is not in camel caps format Open
public static function parse_routes($module, $uri)
- Exclude checks
Property name "$_ci_cached_vars" should not be prefixed with an underscore to indicate visibility Open
public $_ci_cached_vars = [];
- Exclude checks
Method name "_add_module_paths" should not be prefixed with an underscore to indicate visibility Open
public function _add_module_paths($module = '')
- Exclude checks
Method name "MX_Loader::_ci_load" is not in camel caps format Open
public function _ci_load($_ci_data)
- Exclude checks
Method name "Modules::load_file" is not in camel caps format Open
public static function load_file($file, $path, $type = 'other', $result = true)
- Exclude checks
Method name "MX_Router::_set_404override_controller" is not in camel caps format Open
protected function _set_404override_controller()
- Exclude checks
The CASE body must start on the line following the statement Open
case 3: $_route = ($this->located == 2) ? $directory.'/'.$class : $class.'/index';
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (version_compare(phpversion(), '7.1', '<')) {
// php version isn't high enough
list($path, $_helper) = Modules::find($helper.'_helper', $this->_module, 'helpers/');
} else {
[$path, $_helper] = Modules::find($helper.'_helper', $this->_module, 'helpers/');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 91.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (version_compare(phpversion(), '7.1', '<')) {
// php version isn't high enough
list($path, $_plugin) = Modules::find($plugin.'_pi', $this->_module, 'plugins/');
} else {
[$path, $_plugin] = Modules::find($plugin.'_pi', $this->_module, 'plugins/');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 91.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid too many return
statements within this method. Open
return array_slice($segments, 2);
Avoid too many return
statements within this method. Open
return $this->language;
Avoid too many return
statements within this method. Open
return array_slice($segments, 1);
Avoid too many return
statements within this method. Open
return array_slice($segments, 1);
Avoid too many return
statements within this method. Open
return $segments;
Missing class import via use statement (line '61', column '24'). Open
$CFG = new MX_Config;
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '59', column '25'). Open
$LANG = new MX_Lang;
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method load has a boolean flag argument $use_sections, which is a certain sign of a Single Responsibility Principle violation. Open
public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method load has a boolean flag argument $fail_gracefully, which is a certain sign of a Single Responsibility Principle violation. Open
public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method load has a boolean flag argument $return, which is a certain sign of a Single Responsibility Principle violation. Open
public function load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '', $_module = '')
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method config has a boolean flag argument $use_sections, which is a certain sign of a Single Responsibility Principle violation. Open
public function config($file, $use_sections = false, $fail_gracefully = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}