Showing 702 of 1,100 total issues
Function MaxFileSize
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function MaxFileSize()
{
if (phpthumb_functions::gd_version() < 2) {
$this->DebugMessage('Skipping MaxFileSize() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
return false;
- 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 GD2ICOstring
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function GD2ICOstring(&$gd_image_array)
{
$ImageWidths = [];
$ImageHeights = [];
$bpp = [];
- 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 SetCacheFilename
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function SetCacheFilename()
{
if (null !== $this->cache_filename) {
$this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
Method ImageCreateFromStringReplacement
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors = false)
{
// there are serious bugs in the non-bundled versions of GD which may cause
// PHP to segfault when calling imagecreatefromstring() - avoid if at all possible
// when not using a bundled version of GD2
Function MakePie
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function MakePie(
$filename,
$pieWidth,
$pieHeight,
$ShadowDistance,
- 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 OutputThumbnail
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function OutputThumbnail()
{
$this->purgeTempFiles();
if (!$this->useRawIMoutput && !(is_resource($this->gdimg_output) || (is_object($this->gdimg_source) && $this->gdimg_source instanceof \GdImage))) {
Method WatermarkOverlay
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment = '*', $opacity = 50, $margin_x = 5, $margin_y = null)
{
if ((is_resource($gdimg_dest) || (is_object($gdimg_dest) && $gdimg_dest instanceof \GdImage)) && (is_resource($img_watermark) || (is_object($img_watermark) && $img_watermark instanceof \GdImage))) {
$img_source_width = imagesx($gdimg_dest);
$img_source_height = imagesy($gdimg_dest);
Function ImageCreateFromFilename
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function ImageCreateFromFilename($filename)
{
// try to create GD image source directly via GD, if possible,
// rather than buffering to memory and creating with imagecreatefromstring
$ImageCreateWasAttempted = false;
- 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 getPng
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getPng($bgColor)
{
$out = '';
if (!$this->m_bLoaded) {
- 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 setOutputFormat
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function setOutputFormat()
{
static $alreadyCalled = false;
if ($this->thumbnailFormat && $alreadyCalled) {
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 ImageCreateFromFilename
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function ImageCreateFromFilename($filename)
{
// try to create GD image source directly via GD, if possible,
// rather than buffering to memory and creating with imagecreatefromstring
$ImageCreateWasAttempted = false;
- 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 SafeURLread
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function SafeURLread($url, &$error, $timeout = 10, $followredirects = true)
{
$error = '';
$errstr = '';
$rawData = '';
- 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 LZWCommand
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function LZWCommand(&$data, $bInit)
{
if ($bInit) {
$this->SetCodeSize = ord($data[0]);
$data = substr($data, 1);
Method SetCacheFilename
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function SetCacheFilename()
{
if (null !== $this->cache_filename) {
$this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
return true;
Utility
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Utility
{
use Common\VersionChecks; //checkVerXoops, checkVerPhp Traits
use Common\ServerStats; // getServerStats Trait
Function RenderOutput
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function RenderOutput()
{
if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
$this->DebugMessage('RenderOutput() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__);
- 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 prepareSettings
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function prepareSettings()
{
if (0 == !$this->getValue('field')) {
// field already exists (editing mode)
- 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 ImageMagickCommandlineBase
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function ImageMagickCommandlineBase()
{
static $commandline = null;
if (null === $commandline) {
if ($this->issafemode) {
- 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 setCacheDirectory
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function setCacheDirectory()
{
// resolve cache directory to absolute pathname
$this->DebugMessage('setCacheDirectory() starting with config_cache_directory = "' . $this->config_cache_directory . '"', __FILE__, __LINE__);
if ($this->config_cache_directory && ($this->config_cache_directory[0] == '.')) {
- 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 ImageMagickCommandlineBase
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function ImageMagickCommandlineBase()
{
static $commandline = null;
if (null === $commandline) {
if ($this->issafemode) {
- 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"