Showing 9 of 11 total issues
File FiscalRepository.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of the Laudis Fiscal package.
*
Function sortAndSplitRanges
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function sortAndSplitRanges(Vector $ranges): Vector
{
$ranges = $ranges
->filter($this->validRangePredicate())
->filter($this->duplicateRangePredicate())
- 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 run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(): void
{
$ivs = $this->pullIndexedValues();
$scales = $this->query('SELECT * FROM scales')->fetchAll(PDO::FETCH_ASSOC);
$emptyStart = $this->faker->numberBetween(0, 4) === 0;
Function run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function run(): void
{
$ivs = $this->pullIndexedValues();
$scales = $this->query('SELECT * FROM scales')->fetchAll(PDO::FETCH_ASSOC);
$emptyStart = $this->faker->numberBetween(0, 4) === 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
Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(): void
{
$ivs = $this->query(<<<SQL
SELECT iv.slug as slug,
iv.id as id,
Method sortAndSplitRanges
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sortAndSplitRanges(Vector $ranges): Vector
{
$ranges = $ranges
->filter($this->validRangePredicate())
->filter($this->duplicateRangePredicate())
Function limitAndMergeRanges
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function limitAndMergeRanges(Map $scaleRanges, Map $scaleToIndexedValueMapping, Map $indexedValueRanges): void
{
foreach ($scaleRanges as $slug => $ranges) {
$min = PHP_INT_MAX;
$max = PHP_INT_MIN;
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(int $id, string $slug, string $name, float $value, IndexType $type, int $precision)
Function run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function run(): void
{
$ivs = $this->query(<<<SQL
SELECT iv.slug as slug,
iv.id as id,
- 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"