Function runWithConfig
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
private function runWithConfig($output)
{
$filename = getcwd() . '/phpqb.json';
if (!file_exists($filename)) return $output->writeln('<error>No phpqb.json in current dirctory. Please initialize PHPQueryBuilder.</error>');
Method runWithConfig
has 76 lines of code (exceeds 25 allowed). Consider refactoring.
private function runWithConfig($output)
{
$filename = getcwd() . '/phpqb.json';
if (!file_exists($filename)) return $output->writeln('<error>No phpqb.json in current dirctory. Please initialize PHPQueryBuilder.</error>');
Function __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
public function __construct($fromArray = null)
{
if (!empty($fromArray)) {
foreach ($fromArray as $key => $value) {
if (isset($this->{$key})) $this->{$key} = $value;
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
protected function execute(InputInterface $input, OutputInterface $output)
{
$collection = $input->getOption('collection');
$filename = $input->getOption('filename');
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
protected function execute(InputInterface $input, OutputInterface $output)
{
$collection = $input->getOption('collection');
$filename = $input->getOption('filename');
Function isExcluded
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
private function isExcluded($paths, $exclude)
{
for ($i = 0; $i < count($exclude); $i++) $exclude[$i] = $exclude[$i]->getPath();
if (is_array($paths)) {
Function __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function __construct($fromArray = null)
{
if (!empty($fromArray)) {
foreach ($fromArray as $key => $value) {
if (isset($this->{$key})) $this->{$key} = $value;
Function __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function __construct($fromArray = null)
{
if (!empty($fromArray)) {
foreach ($fromArray as $key => $value) {
if (isset($this->{$key})) $this->{$key} = $value;