Showing 1,049 of 26,336 total issues
Method WatermarkOverlay
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
&$gdimg_dest,
&$img_watermark,
$alignment = '*',
$opacity = 50,
$margin_x = 5,
Avoid deeply nested control flow statements. Open
Open
if (!isset($PixelMap[$x][$y]['alpha']) || ($PixelMap[$x][$y]['alpha'] > 0)) {
if (isset($PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha'])
&& ($PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha'] < 127)
) {
$thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha']);
Avoid deeply nested control flow statements. Open
Open
for ($y = $watermark_margin_y; $y < ($img_source_height + $watermark_source_height); $y += ($watermark_source_height + $watermark_margin_y)) {
imagecopy($gdimg_tiledwatermark, $img_watermark, $x, $y, 0, 0, min($watermark_source_width, $img_source_width - $x - $watermark_margin_x),
min($watermark_source_height, $img_source_height - $y - $watermark_margin_y));
}
Method ScaleToFitInBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$width,
$height,
$maxwidth = null,
$maxheight = null,
$allow_enlarge = true,
Avoid deeply nested control flow statements. Open
Open
if ($tempfilename = phpthumb::phpThumb_tempnam()) {
if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
fwrite($fp_tempfile, base64_decode('R0lGODlhAQABAIAAAH//AP///ywAAAAAAQABAAACAUQAOw==')); // very simple 1px GIF file base64-encoded as string
fclose($fp_tempfile);
Function HistogramAnalysis
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function HistogramAnalysis(&$gdimg, $calculateGray = false)
{
$ImageSX = imagesx($gdimg);
$ImageSY = imagesy($gdimg);
for ($x = 0; $x < $ImageSX; $x++) {
- 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
Open
if ($imagetypes & IMG_PNG) {
$gd_info['PNG Support'] = true;
}
Avoid deeply nested control flow statements. Open
Open
if ($imagetypes & IMG_WBMP) {
$gd_info['WBMP Support'] = true;
}
Avoid deeply nested control flow statements. Open
Open
switch ($errno) {
case 200:
// great, continue
break;
Consider simplifying this complex logical expression. Open
Open
if (ev.ctrlKey) {
switch (K) {
case 37: // KEY left
act && Calendar.cellClick(cal._nav_pm);
break;
Consider simplifying this complex logical expression. Open
Open
if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
|| (sg && sg === this.slideshowGroup)) {
if (this.isImage || (this.isHtml && o.useOnHtml))
this.createOverlay(o);
}
Consider simplifying this complex logical expression. Open
Open
if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
|| (sg && sg === this.slideshowGroup)) {
this.createOverlay(o);
}
Consider simplifying this complex logical expression. Open
Open
if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
|| (sg && sg === this.slideshowGroup)) {
this.createOverlay(o);
}
Consider simplifying this complex logical expression. Open
Open
if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
|| (sg && sg === this.slideshowGroup)) {
if (this.isImage || (this.isHtml && o.useOnHtml))
this.createOverlay(o);
}
Consider simplifying this complex logical expression. Open
Open
if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && $_POST['fct'] === 'modulesadmin'
&& $_POST['op'] === 'update_ok'
&& $_POST['dirname'] == $modversion['dirname']
) {
include __DIR__ . '/include/onupdate.inc.php';
Function deletePic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function deletePic(url, p, e, m, n) {
Function setPosition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
setPosition: function (pos, offset, vis, dur, easing) {
Function createElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createElement: function (tag, attribs, styles, parent, nopad) {
Function createElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createElement: function (tag, attribs, styles, parent, nopad) {
Function setPosition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
setPosition: function (pos, offset, vis, dur, easing) {