Showing 702 of 1,100 total issues
Function Crop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function Crop(&$gdimg, $left = 0, $right = 0, $top = 0, $bottom = 0)
{
if (!$left && !$right && !$top && !$bottom) {
return true;
}
- 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 filedate_remote
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function filedate_remote($remotefile, $timeout = 10)
{
$date = false;
$parsed_url = self::ParseURLbetter($remotefile);
if ($fp = @fsockopen($parsed_url['host'], $parsed_url['port'], $errno, $errstr, $timeout)) {
- 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 phpThumbURL
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function phpThumbURL($ParameterString, $path_to_phpThumb = 'phpThumb.php')
{
global $PHPTHUMB_CONFIG;
if (is_array($ParameterString)) {
$ParameterStringArray = $ParameterString;
- 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 isBlockCloned
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
Method MakePie
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$filename,
$pieWidth,
$pieHeight,
$ShadowDistance,
$pieBackgroundColor,
Method setOrder
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
Avoid deeply nested control flow statements. Open
if (n <= 14) {
r = 255 - (n * 17);
g = b = 0;
} else if (n > 14 && n <= 28) {
g = 255 - ((n - 14) * 17);
Avoid deeply nested control flow statements. Open
if(el.is('img')) {
el.attr('src', value);
} else {
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
}
Avoid deeply nested control flow statements. Open
if (base.authority !== null && base.path === '') {
t.path = '/' + r.path;
} else {
t.path = base.path.replace(/[^\/]+$/, '') + r.path;
}
Function getViewSize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getViewSize: function () {
if (typeof window.innerWidth === 'number') {
return [window.innerWidth, window.innerHeight];
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
return [document.body.clientWidth, document.body.clientHeight];
- 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 hsv2hex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function hsv2hex($h, $s, $v)
{
$s /= 256.0;
$v /= 256.0;
if (0.0 == $s) {
- 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 getFollowingStep
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getFollowingStep($step)
{
$ret = null;
$steps = \array_keys($this->_steps);
- 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 getFileStatus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
{
global $pathIcon16;
if (empty($file_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 GenerateThumbnail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function GenerateThumbnail()
{
$this->setOutputFormat();
$this->phpThumbDebug('8a');
$this->ResolveSource();
- 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 ImageMagickWhichConvert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function ImageMagickWhichConvert()
{
static $WhichConvert = null;
if (null === $WhichConvert) {
if ($this->iswindows) {
- 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 lettersChoice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
Avoid deeply nested control flow statements. Open
if (preg_match('# \\-crop "([0-9]+)x([0-9]+)\\+0\\+0" #', $commandline, $matches)) {
$commandline = str_replace(' -crop "' . $matches[1] . 'x' . $matches[2] . '+0+0" ', ' -crop ' . phpthumb_functions::escapeshellarg_replacement(($matches[1] - (2 * $width)) . 'x' . ($matches[2] - (2 * $width)) . '+0+0') . ' ', $commandline);
} elseif (preg_match('# \\-' . $IMresizeParameter . ' "([0-9]+)x([0-9]+)" #', $commandline, $matches)) {
$commandline = str_replace(
' -' . $IMresizeParameter . ' "' . $matches[1] . 'x' . $matches[2] . '" ',
Function file_exists_ignoreopenbasedir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function file_exists_ignoreopenbasedir($filename, $cached = true)
{
static $open_basedirs = null;
static $file_exists_cache = [];
if (!$cached || !isset($file_exists_cache[$filename])) {
- 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 deeply nested control flow statements. Open
if (!phpthumb_functions::IsHexColor($color)) {
$color = ((!empty($this->bc)
&& phpthumb_functions::IsHexColor($this->bc)) ? $this->bc : '000000');
}
Avoid deeply nested control flow statements. Open
for ($y = 0; $y < $this->thumbnail_height; $y++) {
$PixelColor = phpthumb_functions::GetPixelColor($this->gdimg_output, $x, $y);
imagesetpixel($img_alpha_mixdown_dither, $x, $y, $dither_color[$PixelColor['alpha'] * 2]);
}