Showing 47 of 50 total issues
Function handle
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
- 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 handle
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
- 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 handle
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
- 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 parse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function parse(bool $skipEmpty = true): array
{
$languages = [];
$header = $this->reader->getHeader();
$rows = $this->reader->getRows()->collect();
- 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 handle
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(): int
{
if (!File::exists(csv_path())) {
$this->error(sprintf("The '%s' does not exists.", csv_path(true)));
$this->line('Please create it with: php artisan larex:init');
Function validateCollection
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected static function validateCollection(Collection $rows): void
{
$compare = null;
foreach ($rows as $i => $columns) {
if (!is_array($columns)) {
- 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 handle
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
Function handle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexExportCommand $command, CsvReader $reader): int
{
$parser = CsvParser::create($reader);
$languages = $parser->parse();
- 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 handle
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
Function handle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexExportCommand $command, CsvReader $reader): int
{
$parser = CsvParser::create($reader);
$languages = $parser->setHandleSubKey(false)->parse();
- 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 handle
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(LarexImportCommand $command): Collection
{
$include = Str::of($command->option('include'))->explode(',')->reject(fn ($i) => empty($i));
$exclude = Str::of($command->option('exclude'))->explode(',')->reject(fn ($i) => empty($i));
Method handle
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(): int
{
if (!File::exists(csv_path())) {
$this->error(sprintf("The '%s' does not exists.", csv_path(true)));
$this->line('Please create it with: php artisan larex:init');
Method handle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(): int
{
//get the importer name
$importerKey = $this->argument('importer') ?? config('larex.importers.default');
$importers = config('larex.importers.list');
Function handle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function handle(LarexExportCommand $command, CsvReader $reader): int
{
$parser = CsvParser::create($reader);
$languages = $parser->setHandleSubKey(false)->parse();
- 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 validateRaw
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function validateRaw(): void
{
//read raw csv
/** @var Collection<int,Collection<int,string>> $output */
$output = collect([]);
- 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 handle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(): int
{
$reader = CsvReader::create(csv_path());
$csvRows = $reader->getRows()->collect();
$filesFound = Utils::findFiles(config('larex.search.dirs'), config('larex.search.patterns'));
Method handle
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(CsvReader $reader): void
{
//get keys position
$count = [];
$reader->getRows()->each(function ($columns, $line) use (&$count) {
Function handle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): int
{
if (!File::exists(csv_path())) {
$this->error(sprintf("The '%s' does not exists.", csv_path(true)));
$this->line('Please create it with: php artisan larex:init');
- 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 handle
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): int
{
//get the importer name
$importerKey = $this->argument('importer') ?? config('larex.importers.default');
$importers = config('larex.importers.list');
- 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 handle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(LarexExportCommand $command, CsvReader $reader): int
{
$parser = CsvParser::create($reader);
$languages = $parser->parse();