Showing 44 of 100 total issues
Function convertByInnerFit
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function convertByInnerFit(Imagick $imagick, Sampler\Format $format): Imagick
{
$srcWidth = $imagick->getImageWidth();
$srcHeight = $imagick->getImageHeight();
$srcRatio = $srcWidth / $srcHeight;
- 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 getFormatedImageRows
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getFormatedImageRows(array $imagesId, string $formatName): array
{
$destImageRows = [];
if (count($imagesId)) {
$select = $this->imageTable->getSql()->select()
- 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 convertByInnerFit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function convertByInnerFit(Imagick $imagick, Sampler\Format $format): Imagick
{
$srcWidth = $imagick->getImageWidth();
$srcHeight = $imagick->getImageHeight();
$srcRatio = $srcWidth / $srcHeight;
Method generateLockWrite
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateLockWrite(string $dirName, array $options, int $width, int $height, Closure $callback): int
{
$insertAttemptException = null;
$imageId = 0;
$attemptIndex = 0;
Function setImageCrop
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function setImageCrop(int $imageId, ?array $crop): void
{
if (! $imageId) {
throw new Storage\Exception("Invalid image id provided `$imageId`");
}
- 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 extendVertical
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function extendVertical(Imagick $imagick, Sampler\Format $format): void
{
$fRatio = (int) $format->getWidth() / (int) $format->getHeight();
$srcWidth = $imagick->getImageWidth();
- 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 convertByMaximumFit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function convertByMaximumFit(Imagick $imagick, Sampler\Format $format): Imagick
{
$srcWidth = $imagick->getImageWidth();
$srcHeight = $imagick->getImageHeight();
$srcRatio = $srcWidth / $srcHeight;
- 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 convertByOuterFit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function convertByOuterFit(Imagick $imagick, Sampler\Format $format): Imagick
{
$srcWidth = $imagick->getImageWidth();
$srcHeight = $imagick->getImageHeight();
$srcRatio = $srcWidth / $srcHeight;
- 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 extendHorizontal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function extendHorizontal(Imagick $imagick, Sampler\Format $format): void
{
$fRatio = (int) $format->getWidth() / (int) $format->getHeight();
$srcWidth = $imagick->getImageWidth();
- 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 convertByMaximumFit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function convertByMaximumFit(Imagick $imagick, Sampler\Format $format): Imagick
{
$srcWidth = $imagick->getImageWidth();
$srcHeight = $imagick->getImageHeight();
$srcRatio = $srcWidth / $srcHeight;
Method extendEdgeColor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extendEdgeColor(ImagickPixelIterator $iterator): ?ImagickPixel
{
$sum = [
'r' => [],
'g' => [],
Method flush
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function flush(array $options): StorageInterface
{
$defaults = [
'format' => null,
'image' => null,
Method flop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function flop(int $imageId): void
{
$imageRow = $this->getImageRow($imageId);
if (! $imageRow) {
Method normalize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalize(int $imageId): void
{
$imageRow = $this->getImageRow($imageId);
if (! $imageRow) {
Method buildImageResult
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildImageResult($imageRow): Storage\Image
{
$dir = $this->getDir($imageRow['dir']);
if (! $dir) {
throw new Storage\Exception("Dir '{$imageRow['dir']}' not defined");
Function addImageFromFile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function addImageFromFile(string $file, string $dirName, array $options = []): int
{
$imageInfo = getimagesize($file);
$width = (int) $imageInfo[0];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function addImageFromImagick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addImageFromImagick(Imagick $imagick, string $dirName, array $options = []): int
{
$width = $imagick->getImageWidth();
$height = $imagick->getImageHeight();
- 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 changeImageName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function changeImageName(int $imageId, array $options = []): void
{
$imageRow = $this->getImageRow($imageId);
if (! $imageRow) {
throw new Storage\Exception("Image `$imageId` not found");
- 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 generateLockWrite
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function generateLockWrite(string $dirName, array $options, int $width, int $height, Closure $callback): int
Method crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function crop(Imagick $imagick, int $width, int $height, int $left, int $top): Imagick