Method processBatch
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processBatch($type, $transformer)
{
$this->output->writeln(self::completeLine("Creating Type {$type} and Mapping"));
$objectType = $this->getIndexFromType($type)->getType($type);
Function execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->init($input, $output);
if ($input->getOption('where') && ! $input->getOption('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"
Further reading
Method runParallel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runParallel(ProgressBar $progressBar, array $processes, $maxParallel, $poll = 1000, $numberOfEntities)
{
// do not modify the object pointers in the argument, copy to local working variable
$processesQueue = $processes;
// fix maxParallel to be max the number of processes or positive
Method _getQuery
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _getQuery($type, &$iResults)
{
$id = filter_var($this->id, FILTER_SANITIZE_STRING);
$where = filter_var($this->where, FILTER_SANITIZE_STRING);
$joins = filter_var($this->join, FILTER_SANITIZE_STRING);
Function runParallel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function runParallel(ProgressBar $progressBar, array $processes, $maxParallel, $poll = 1000, $numberOfEntities)
{
// do not modify the object pointers in the argument, copy to local working variable
$processesQueue = $processes;
// fix maxParallel to be max the number of processes or positive
- 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 execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->init($input, $output);
if ($input->getOption('where') && ! $input->getOption('id')) {
Function processBatch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function processBatch($type, $transformer)
{
$this->output->writeln(self::completeLine("Creating Type {$type} and Mapping"));
$objectType = $this->getIndexFromType($type)->getType($type);
- 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 _getQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function _getQuery($type, &$iResults)
{
$id = filter_var($this->id, FILTER_SANITIZE_STRING);
$where = filter_var($this->where, FILTER_SANITIZE_STRING);
$joins = filter_var($this->join, FILTER_SANITIZE_STRING);
- 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 runParallel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function runParallel(ProgressBar $progressBar, array $processes, $maxParallel, $poll = 1000, $numberOfEntities)
Avoid too many return
statements within this method. Open
return $returnValue;