Showing 6 of 6 total issues
ImageStorage
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class ImageStorage implements Storage
{
/**
* The directory to store the images in
File ImageStorage.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Rostenkowski\Resize;
Method crop
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function crop(Image $image, Request $request)
{
if ($request->getDimensions() === Request::ORIGINAL) {
return $image;
Function crop
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function crop(Image $image, Request $request)
{
if ($request->getDimensions() === Request::ORIGINAL) {
return $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
Function checkImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function checkImage(Request $request)
{
$filename = $this->createCacheFilename($request);
if (!file_exists($filename)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function check($name, $tryCreateDirectories = true)
{
$exists = true;
$isWritable = true;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"