Method resizeImage
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeImage()
{
/** @var Wflinks\Helper $helper */
$helper = Wflinks\Helper::getInstance();
Function resizeImage
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function resizeImage()
{
/** @var Wflinks\Helper $helper */
$helper = Wflinks\Helper::getInstance();
- 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 createThumb
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createThumb(
$img_width = null,
$img_height = null,
$img_quality = null,
$img_update = null,
Function createThumb
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createThumb(
$img_width = null,
$img_height = null,
$img_quality = null,
$img_update = 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
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($img_name = null, $img_path = null, $img_savepath = null)
{
if (!\preg_match("/\.(jpg|gif|png|jpeg)$/i", $img_name)) {
// return false;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method createThumb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$img_width = null,
$img_height = null,
$img_quality = null,
$img_update = null,
$img_aspect = null
Avoid too many return
statements within this method. Open
return DEFAULT_PATH;
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 $this->_source_url . "/{$this->_img_savepath}/{$savefile}";
Avoid too many return
statements within this method. Open
return $image;
Avoid too many return
statements within this method. Open
return "{$this->_img_savepath}/{$savefile}";