Showing 426 of 426 total issues
Function html
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function html()
{
if (class_exists('ZipArchive'))
{
if (ini_get('zlib.output_compression'))
- 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 getReversedValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function getReversedValue($results)
{
$results2 = array();
foreach ($results as $k => $v)
{
- 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 trashControl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function trashControl($act)
{
$id = intval(Input::get('id'));
$item = Model\Icl::fetch($id);
if (empty($item)) Util::error('Icl not found');
- 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 trashControl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function trashControl($act)
{
$id = intval(Input::get('id'));
$item = Model\Issue::fetch($id);
if (empty($item)) Util::error('issue not found');
- 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 passed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function passed($cs, $yml)
{
$passed = array();
foreach ($yml['passes'] as $code => $codes)
{
- 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 key2link
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function key2link($text, $doc_url = '')
{
preg_match_all("/\[[^\]]+?\]/", $text, $ms);
if ( ! $ms[0]) return $text;
- 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 criterionsOfLevels
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function criterionsOfLevels()
{
$yml = Yaml::fetch();
// levels
$levels = 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $array;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return static::value($default);
Avoid too many return
statements within this method. Open
return static::$langs[$url];
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Missing class import via use statement (line '175', column '17'). Open
$client = new \GuzzleHttp\Client(array(
- 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
Remove error control operator '@' on line 102. Open
public static function getLatestVersion ()
{
if ( ! self::isFisrtOfToday()) return false;
if ( ! is_null(self::$latest_version)) return self::$latest_version;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '84', column '16'). Open
$dbh = new \PDO($dtbs, $config['user'], $config['password']);
- 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();
}