tryBrowserCache accesses the super-global variable $_SERVER. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
__construct accesses the super-global variable $_SERVER. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
param accesses the super-global variable $_GET. Open
protected function param($property, $default = '')
{
if (isset($_GET[$property])) {
return Request::getString($property, '', 'GET');
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getIP accesses the super-global variable $_SERVER. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getLocalImagePath accesses the super-global variable $_SERVER. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
tryBrowserCache accesses the super-global variable $_SERVER. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getIP accesses the super-global variable $_SERVER. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
__construct accesses the super-global variable $_SERVER. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getLocalImagePath accesses the super-global variable $_SERVER. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
serveErrors accesses the super-global variable $_SERVER. Open
protected function serveErrors()
{
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
if (!DISPLAY_ERROR_MESSAGES) {
return;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
serveErrors accesses the super-global variable $_SERVER. Open
protected function serveErrors()
{
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
if (!DISPLAY_ERROR_MESSAGES) {
return;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getLocalImagePath accesses the super-global variable $_SERVER. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getIP accesses the super-global variable $_SERVER. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
__construct accesses the super-global variable $_SERVER. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
calcDocRoot accesses the super-global variable $_SERVER. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
File thumb.php
has 1190 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/**
* TimThumb by Ben Gillbanks and Mark Maunder
* Based on work done by Tim McDaniels and Darren Hoyt
* https://code.google.com/p/timthumb/
Function processImageAndWriteToCache
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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 processImageAndWriteToCache
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
Function __construct
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- 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
Timthumb
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Timthumb
{
protected $src = '';
protected $is404 = false;
protected $docRoot = '';
Method __construct
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
The class Timthumb has 28 non-getter- and setter-methods. Consider refactoring Timthumb to keep number of methods under 25. Open
class Timthumb
{
protected $src = '';
protected $is404 = false;
protected $docRoot = '';
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class Timthumb has an overall complexity of 243 which is very high. The configured complexity threshold is 50. Open
class Timthumb
{
protected $src = '';
protected $is404 = false;
protected $docRoot = '';
- Exclude checks
Function getLocalImagePath
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- 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 getURL
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
Function getURL
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- 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 cleanCache
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
- 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 getLocalImagePath
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
Method serveWebshot
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveWebshot()
{
$this->debug(3, 'Starting serveWebshot');
$instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
if (!is_file(WEBSHOT_CUTYCAPT)) {
Function tryServerCache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
- 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 tryBrowserCache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
- 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
The class Timthumb has 21 fields. Consider redesigning Timthumb to keep the number of fields under 15. Open
class Timthumb
{
protected $src = '';
protected $is404 = false;
protected $docRoot = '';
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Method tryBrowserCache
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
Function handleErrors
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function handleErrors()
{
if ($this->haveErrors()) {
if (NOT_FOUND_IMAGE && $this->is404()) {
if ($this->serveImg(NOT_FOUND_IMAGE)) {
- 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 serveCacheFile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveCacheFile()
{
$this->debug(3, "Serving {$this->cachefile}");
if (!is_file($this->cachefile)) {
$this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
Function run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
if ($this->isURL) {
if (!ALLOW_EXTERNAL) {
$this->debug(1, 'Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.');
- 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 cleanCache
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
Method tryServerCache
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
Method serveExternalImage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveExternalImage()
{
if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
$this->error('Invalid URL supplied.');
Consider simplifying this complex logical expression. Open
if ('png' === $imgType && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)) {
$exec = OPTIPNG_PATH;
$this->debug(3, "optipng'ing $tempfile");
$presize = filesize($tempfile);
$out = shell_exec('$exec -o1 $tempfile'); //you can use up to -o7 but it really slows things down
Function calcDocRoot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- 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 getIP
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- 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 serveWebshot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function serveWebshot()
{
$this->debug(3, 'Starting serveWebshot');
$instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
if (!is_file(WEBSHOT_CUTYCAPT)) {
- 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 $real;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $ci;
Avoid too many return
statements within this method. Open
return false;
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;
Avoid too many return
statements within this method. Open
return 'UNKNOWN';
Avoid too many return
statements within this method. Open
return $this->error('You may not fetch images from that site. To enable this site in timthumb, you can either add it to $allowedSites and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.');
Avoid too many return
statements within this method. Open
return $this->error('Could not open the lockfile for writing an image.');
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
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 $this->error('Could not get a lock for writing.');
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $ff;
Avoid too many return
statements within this method. Open
return $this->serveCacheFile();
Avoid too many return
statements within this method. Open
return false;
The class Timthumb has 1344 lines of code. Current threshold is 1000. Avoid really long classes. Open
class Timthumb
{
protected $src = '';
protected $is404 = false;
protected $docRoot = '';
- Exclude checks
The method __construct() has an NPath complexity of 43200. The configured NPath complexity threshold is 200. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method __construct() has 106 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Exclude checks
The method processImageAndWriteToCache() has an NPath complexity of 302778777600. The configured NPath complexity threshold is 200. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getLocalImagePath() has an NPath complexity of 864. The configured NPath complexity threshold is 200. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getURL() has an NPath complexity of 238. The configured NPath complexity threshold is 200. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method serveWebshot() has an NPath complexity of 1024. The configured NPath complexity threshold is 200. Open
protected function serveWebshot()
{
$this->debug(3, 'Starting serveWebshot');
$instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
if (!is_file(WEBSHOT_CUTYCAPT)) {
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method processImageAndWriteToCache() has 311 lines of code. Current threshold is set to 100. Avoid really long methods. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Exclude checks
The method processImageAndWriteToCache() has a Cyclomatic Complexity of 65. The configured cyclomatic complexity threshold is 10. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method serveWebshot() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
protected function serveWebshot()
{
$this->debug(3, 'Starting serveWebshot');
$instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
if (!is_file(WEBSHOT_CUTYCAPT)) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getURL() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method __construct() has a Cyclomatic Complexity of 23. The configured cyclomatic complexity threshold is 10. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getLocalImagePath() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Remove error control operator '@' on line 536. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
- 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
Remove error control operator '@' on line 538. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
- 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
Remove error control operator '@' on line 970. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 1512. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- 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
Remove error control operator '@' on line 305. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- 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
Remove error control operator '@' on line 985. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 999. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- 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
Remove error control operator '@' on line 1262. Open
protected function serveCacheFile()
{
$this->debug(3, "Serving {$this->cachefile}");
if (!is_file($this->cachefile)) {
$this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
- 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
Remove error control operator '@' on line 1211. Open
protected function serveExternalImage()
{
if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
$this->error('Invalid URL supplied.');
- 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 '310', column '31'). Open
throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
- 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 925. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 978. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 1377. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- 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
Remove error control operator '@' on line 1379. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- 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
Remove error control operator '@' on line 1572. Open
protected function serveImg($file)
{
$s = getimagesize($file);
if (!($s && $s['mime'])) {
return false;
- 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
Remove error control operator '@' on line 395. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- 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
Remove error control operator '@' on line 940. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 408. Open
public function __destruct()
{
foreach ($this->toDeletes as $del) {
$this->debug(2, "Deleting temp file $del");
@unlink($del);
- 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
Remove error control operator '@' on line 655. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
- 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
Remove error control operator '@' on line 960. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 1511. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- 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
Remove error control operator '@' on line 1576. Open
protected function serveImg($file)
{
$s = getimagesize($file);
if (!($s && $s['mime'])) {
return false;
- 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
Remove error control operator '@' on line 666. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
- 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
Remove error control operator '@' on line 668. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
- 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
Remove error control operator '@' on line 1268. Open
protected function serveCacheFile()
{
$this->debug(3, "Serving {$this->cachefile}");
if (!is_file($this->cachefile)) {
$this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
- 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
Remove error control operator '@' on line 492. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
- 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
Remove error control operator '@' on line 1378. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- 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
Remove error control operator '@' on line 305. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- 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
Remove error control operator '@' on line 558. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
- 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
Remove error control operator '@' on line 982. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 986. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- 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
Remove error control operator '@' on line 1200. Open
protected function serveExternalImage()
{
if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
$this->error('Invalid URL supplied.');
- 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
Remove error control operator '@' on line 1535. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- 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
Avoid using static access to class '\Xmf\Request' in method '__construct'. Open
if (BLOCK_EXTERNAL_LEECHERS && array_key_exists('HTTP_REFERER', $_SERVER) && (!preg_match('/^https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', \Xmf\Request::getString('HTTP_REFERER', '', 'SERVER')))) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(2, 'Is a request for an internal file: ' . $this->src);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$origin_y = $newHeight / 2;
$newHeight = $final_height;
$origin_y = round($origin_y - ($newHeight / 2));
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$filterSettings[$i] = null;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(1, 'optipng did not change image size.');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->localImage = $this->getLocalImagePath($this->src);
if (!$this->localImage) {
$this->debug(1, "Could not find the local image: {$this->localImage}");
$this->error('Could not find the internal image you specified.');
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method 'tryBrowserCache'. Open
if (\Xmf\Request::hasVar('HTTP_IF_MODIFIED_SINCE', 'SERVER')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $this->sanityFail('Could not match mime type after verifying it previously.');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(1, "pngcrush did not reduce file size. Difference was $sizeDrop bytes.");
$todel = $tempfile2;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, "pngcrush failed with output: $out");
$todel = $tempfile2;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method serveWebshot uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$command = "$xv --server-args=\"-screen 0, {$screenX}x{$screenY}x{$colDepth}\" $cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method '__construct'. Open
$this->myHost = preg_replace('/^www\./i', '', \Xmf\Request::getString('HTTP_HOST', '', 'SERVER'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method tryServerCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, "Trying to serve cachefile {$this->cachefile}");
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->error('You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED === true to enable webshots.');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// copy and resize part of an image with resampling
imagecopyresampled($canvas, $image, 0, 0, 0, 0, (int)$newWidth, (int)$newHeight, (int)$width, (int)$height);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, 'webshot is NOT set so we\'re going to try to fetch a regular image.');
$this->serveExternalImage();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$color = imagecolorallocatealpha($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 0);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method 'calcDocRoot'. Open
if (\Xmf\Request::hasVar('PATH_TRANSLATED', 'SERVER')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method setMemoryLimit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, 'Not adjusting memory size because the current setting is ' . $inimem . ' and our size of ' . MEMORY_LIMIT . ' is smaller.');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method '__construct'. Open
$this->debug(1, 'Starting new request from ' . $this->getIP() . ' to ' . Request::getString('REQUEST_URI', '', 'SERVER'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->cacheDirectory = sys_get_temp_dir();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, 'Got request for internal image. Starting serveInternalImage()');
$this->serveInternalImage();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(2, 'Fetching only from selected external sites is enabled.');
$allowed = false;
foreach ($allowedSites as $site) {
if ((mb_strtolower($this->url['host']) === \mb_strtolower($site)) || (mb_strtolower(mb_substr($this->url['host'], -mb_strlen($site) - 1)) === \mb_strtolower(".$site"))) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method 'calcDocRoot'. Open
if (\Xmf\Request::hasVar('SCRIPT_FILENAME', 'SERVER')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$newHeight = $final_height;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '309', column '28'). Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method processImageAndWriteToCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
fclose($fh);
@unlink($lockFile);
@unlink($tempfile4);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method 'param'. Open
return Request::getString($property, '', 'GET');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLocalImagePath uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$subDirectories = explode('/', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method sendImageHeaders uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->debug(3, 'Browser caching is enabled');
header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate');
header('Expires: ' . $gmdateExpires);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method handleErrors() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused parameters such as '$h'. Open
public static function curlWrite($h, $d)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The method handleErrors() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
The method start() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
The method start() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused local variables such as '$exec'. Open
$exec = OPTIPNG_PATH;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The method handleErrors() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
The method start() contains an exit expression. Open
exit(0);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid excessively long variable names like $filePrependSecurityBlock. Keep variable name length under 20. Open
protected $filePrependSecurityBlock = "<?php exit('Execution denied!'); //"; //Designed to have three letter mime type, space, question mark and greater than symbol appended. 6 bytes total.
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Timthumb
- Exclude checks
Avoid variables with short names like $h. Configured minimum length is 3. Open
public static function curlWrite($h, $d)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $ci. Configured minimum length is 3. Open
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $d. Configured minimum length is 3. Open
public static function curlWrite($h, $d)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fh. Configured minimum length is 3. Open
$fh = fopen($lockFile, 'wb');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $ua. Configured minimum length is 3. Open
$ua = WEBSHOT_USER_AGENT;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $s. Configured minimum length is 3. Open
$s = getimagesize($file);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $ff. Configured minimum length is 3. Open
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fp. Configured minimum length is 3. Open
$fp = fopen($tempfile, 'rb', false, $context);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fp. Configured minimum length is 3. Open
$fp = fopen($this->cachefile, 'rb');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $xv. Configured minimum length is 3. Open
$xv = WEBSHOT_XVFB;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 28 and the first side effect is on line 26. Open
<?php declare(strict_types=1);
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $localImageMTime = 0.0;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $filePrependSecurityBlock = "<?php exit('Execution denied!'); //"; //Designed to have three letter mime type, space, question mark and greater than symbol appended. 6 bytes total.
- Exclude checks
The CASE body must start on the line following the statement Open
case 'm':
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $isURL = false;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $cachefile = '';
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $is404 = false;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $cropTop = false;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $salt = '';
- Exclude checks
The CASE body must start on the line following the statement Open
case 'k':
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $localImage = '';
- Exclude checks
The CASE body must start on the line following the statement Open
case 'g':
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $url = false;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $cacheDirectory = '';
- Exclude checks
The CASE body must start on the line following the statement Open
case 1:
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $myHost = '';
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $toDeletes = [];
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $lastBenchTime = 0.0;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $lastURLError = false;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $errors = [];
- Exclude checks
The CASE body must start on the line following the statement Open
case 'M':
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $src = '';
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $startTime = 0.0;
- Exclude checks
Scope keyword "protected" must be followed by a single space Open
protected $docRoot = '';
- Exclude checks
The CASE body must start on the line following the statement Open
case 'image/jpeg':
- Exclude checks
The 'getURL()' method which returns a boolean should be named 'is...()' or 'has...()' Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- Read upRead up
- Exclude checks
BooleanGetMethodName
Since: 0.2
Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
Example
class Foo {
/**
* @return boolean
*/
public function getFoo() {} // bad
/**
* @return bool
*/
public function isFoo(); // ok
/**
* @return boolean
*/
public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}
Source https://phpmd.org/rules/naming.html#booleangetmethodname
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_G is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_w is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_G is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_h is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_R is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_B is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_h is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_h is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_R is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_trans is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gmdate_modified is not named in camelCase. Open
protected function sendImageHeaders($mimeType, $dataSize)
{
if (!preg_match('/^image\//i', $mimeType)) {
$mimeType = 'image/' . $mimeType;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_G is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_R is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_w is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_h is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_trans is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_B is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $canvas_color_B is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $final_height is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_w is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_w is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $src_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gmdate_modified is not named in camelCase. Open
protected function sendImageHeaders($mimeType, $dataSize)
{
if (!preg_match('/^image\//i', $mimeType)) {
$mimeType = 'image/' . $mimeType;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $origin_x is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $cmp_y is not named in camelCase. Open
protected function processImageAndWriteToCache($localImage)
{
$sData = getimagesize($localImage);
$origType = $sData[2];
$mimeType = $sData['mime'];
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}