Showing 9 of 9 total issues
Method loadBulkData
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadBulkData(int $offset): void
{
/** @var Api $importSourceDefinition */
$importSourceDefinition = $this->importSourceDefinition;
$clientFactory = $this->clientFactory;
Function import
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function import(
EntityImporterDefinition $definition,
callable $statusCallback,
callable $errorCallback,
?int $limit
- 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 import
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import(
EntityImporterDefinition $definition,
callable $statusCallback,
callable $errorCallback,
?int $limit
Method render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(StyleInterface $io, ImportResult $importResult): void
{
$errors = $importResult->getErrors();
$numErrors = count($errors);
$numSuccess = $importResult->getSuccess();
Function setData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setData(EntityImporterDefinition $definition, object $entity, array $row): object
{
$converters = $definition->getFieldConverters();
$skippedFields = $definition->getSkippedFields();
foreach ($row as $key => $value) {
- 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
SplFileObject $file,
array $columnHeaders,
?int $headerRowNumber = null,
string $delimiter = ',',
string $enclosure = '"',
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $importFile,
ArchivingStrategy $archivingStrategy,
string $delimiter = ';',
string $enclosure = '"',
string $escape = '\\',
Function getErrors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getErrors(): array
{
if (null === $this->errors) {
$this->errors = [];
/**
- 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 detectSetter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function detectSetter(EntityImporterDefinition $definition, object $entity, string $key, $value): ?string
{
$entityClass = get_class($entity);
if (null !== ($setter = $this->setterCache[$entityClass][$key] ?? null)) {
return $setter;
- 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"