Showing 16 of 16 total issues
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 removeFromElasticSearch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function removeFromElasticSearch($type, $repository, $resultSet)
{
foreach ($resultSet as $result) {
$this->nbrDocumentTested++;
$documentId = $result->getDocument()->getId();
- 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 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 readOption
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function readOption(InputInterface $input)
{
$this->type = $input->getOption('type');
$this->batch = $input->getOption('batch') ?: $this->batch;
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);
Method getConfigTreeBuilder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('headoo_elastic_search');
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 readOption
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function readOption(InputInterface $input)
{
$this->type = $input->getOption('type');
$this->batch = $input->getOption('batch') ?: $this->batch;
- 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
Function getOptionsToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getOptionsToString($excludedOption = [])
{
$aOptions = $this->input->getOptions();
$sOptions = '';
- 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 _catchEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function _catchEvent($entity, $transformer, $connectionName, $indexName, $action)
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;