ridaamirini/PHPQueryBuilder

View on GitHub

Showing 8 of 12 total issues

Function runWithConfig has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

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>');
Severity: Minor
Found in src/PHPQueryBuilder/Command/CommandDump.php - About 4 hrs to fix

Method runWithConfig has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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>');
Severity: Major
Found in src/PHPQueryBuilder/Command/CommandDump.php - About 3 hrs to fix

    Function __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    public function __construct($fromArray = null)
    {
    if (!empty($fromArray)) {
    foreach ($fromArray as $key => $value) {
    if (isset($this->{$key})) $this->{$key} = $value;
    Severity: Minor
    Found in src/PHPQueryBuilder/Schema/ConfigFile.php - About 1 hr to fix

    Method execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
    $collection = $input->getOption('collection');
    $filename = $input->getOption('filename');
     
     
    Severity: Minor
    Found in src/PHPQueryBuilder/Command/CommandDump.php - About 1 hr to fix

      Function execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      protected function execute(InputInterface $input, OutputInterface $output)
      {
      $collection = $input->getOption('collection');
      $filename = $input->getOption('filename');
       
       
      Severity: Minor
      Found in src/PHPQueryBuilder/Command/CommandDump.php - About 45 mins to fix

      Function isExcluded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      private function isExcluded($paths, $exclude)
      {
      for ($i = 0; $i < count($exclude); $i++) $exclude[$i] = $exclude[$i]->getPath();
       
      if (is_array($paths)) {
      Severity: Minor
      Found in src/PHPQueryBuilder/Command/CommandDump.php - About 45 mins to fix

      Function __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      public function __construct($fromArray = null)
      {
      if (!empty($fromArray)) {
      foreach ($fromArray as $key => $value) {
      if (isset($this->{$key})) $this->{$key} = $value;
      Severity: Minor
      Found in src/PHPQueryBuilder/Schema/BaseConfig.php - About 25 mins to fix

      Function __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      public function __construct($fromArray = null)
      {
      if (!empty($fromArray)) {
      foreach ($fromArray as $key => $value) {
      if (isset($this->{$key})) $this->{$key} = $value;
      Severity: Minor
      Found in src/PHPQueryBuilder/Schema/Exclude.php - About 25 mins to fix
      Severity
      Category
      Status
      Source
      Language