netdudes/DataSourceryBundle

View on GitHub

Showing 42 of 42 total issues

Function buildSelectFieldMap has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildSelectFieldMap(Query $query)
    {
        $selectFieldsMap = [];
        $requiredFields = $this->requiredFieldsExtractor->extractRequiredFields($query);
        $joins = $this->joinsGenerator->generate($query);
Severity: Minor
Found in DataSource/Driver/Doctrine/QueryBuilder/SelectGenerator.php - About 2 hrs to fix

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 translateOperator has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function translateOperator($token, FieldInterface $dataSourceElement)
    {
        $translationTable = [
            "T_OP_LT" => [
                FilterCondition::METHOD_NUMERIC_LT,
Severity: Major
Found in UQL/Interpreter.php - About 2 hrs to fix

    File Interpreter.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    namespace Netdudes\DataSourceryBundle\UQL;
    
    use Netdudes\DataSourceryBundle\DataSource\Configuration\Field;
    use Netdudes\DataSourceryBundle\DataSource\Configuration\FieldInterface;
    Severity: Minor
    Found in UQL/Interpreter.php - About 2 hrs to fix

      Function getCellValueByDataSourceField has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getCellValueByDataSourceField(array $dataRow, Field $dataSourceField, $fields)
          {
              $selectAlias = $dataSourceField->getDatabaseSelectAlias();
      
              if (is_array($selectAlias)) {
      Severity: Minor
      Found in DataSource/Driver/Doctrine/DoctrineDriver.php - About 1 hr to fix

      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 transform has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transform(FilterCondition $filterCondition, array $dataSourceFields)
          {
              $filter = new Filter();
              $filter->setConditionType(Filter::CONDITION_TYPE_OR);
      
      
      Severity: Minor
      Found in Query/SearchTextFilterConditionTransformer.php - About 1 hr to fix

      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 buildExpression has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function buildExpression(FilterCondition $filterCondition, $token, QueryBuilder $queryBuilder)
          {
              $identifier = $this->uniqueNameToQueryFieldMap[$filterCondition->getFieldName()];
      
              if (null === $filterCondition->getValue()) {
      Severity: Minor
      Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 1 hr to fix

        Method toUQL has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function toUQL()
            {
                $numericMethods = [
                    self::METHOD_NUMERIC_EQ,
                    self::METHOD_NUMERIC_GT,
        Severity: Minor
        Found in Query/FilterCondition.php - About 1 hr to fix

          Method buildSelectFieldMap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function buildSelectFieldMap(Query $query)
              {
                  $selectFieldsMap = [];
                  $requiredFields = $this->requiredFieldsExtractor->extractRequiredFields($query);
                  $joins = $this->joinsGenerator->generate($query);
          Severity: Minor
          Found in DataSource/Driver/Doctrine/QueryBuilder/SelectGenerator.php - About 1 hr to fix

            Function jsonSerialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function jsonSerialize()
                {
                    $json = [
                        'name' => $this->getName(),
                        'arguments' => [],
            Severity: Minor
            Found in Extension/UqlFunction.php - About 1 hr to fix

            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 __toString has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __toString()
                {
                    $reflection = new \ReflectionMethod($this->instance, $this->method);
                    $methodParameters = $reflection
                        ->getParameters();
            Severity: Minor
            Found in Extension/UqlFunction.php - About 1 hr to fix

            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 matchAssertion has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function matchAssertion()
                {
                    $identifier = $this->nextToken();
            
                    if ($identifier['token'] != 'T_IDENTIFIER') {
            Severity: Minor
            Found in UQL/Parser.php - About 1 hr to fix

              Method jsonSerialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function jsonSerialize()
                  {
                      $json = [
                          'name' => $this->getName(),
                          'arguments' => [],
              Severity: Minor
              Found in Extension/UqlFunction.php - About 1 hr to fix

                Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $uniqueName,
                        $readableName,
                        $description,
                        DataTypeInterface $dataType,
                        $databaseFilterQueryField = null,
                Severity: Major
                Found in DataSource/Configuration/Field.php - About 50 mins to fix

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

                      private function recursivelyAddDependantAliasFields(array $fieldNames)
                      {
                          $dependantFields = [];
                          foreach ($fieldNames as $fieldName) {
                              $field = $this->getField($fieldName);
                  Severity: Minor
                  Found in DataSource/Driver/Doctrine/QueryBuilder/RequiredFieldsExtractor.php - About 45 mins to fix

                  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 build has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function build(Query $query)
                      {
                          $elements = [];
                          $requiredFields = $this->requiredFieldsExtractor->extractRequiredFields($query);
                          foreach ($this->queryBuilderDataSourceFields as $field) {
                  Severity: Minor
                  Found in DataSource/Driver/Doctrine/QueryBuilder/JoinGenerator.php - About 45 mins to fix

                  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 newRawField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private function newRawField($name, $type, $field, $alias, $options)
                  Severity: Minor
                  Found in DataSource/DataSourceBuilder.php - About 35 mins to fix

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function __construct($entityClass, $fields, $transformers, EventDispatcherInterface $eventDispatcher, DriverInterface $doctrineDriver)
                    Severity: Minor
                    Found in DataSource/DataSource.php - About 35 mins to fix

                      Method addVectorField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function addVectorField($name, $type, $filteringField, array $aliasedFields, array $options = [])
                      Severity: Minor
                      Found in DataSource/DataSourceBuilder.php - About 35 mins to fix

                        Method addVectorField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function addVectorField($name, $type, $filteringField, array $aliasedFields, array $options = []);
                        Severity: Minor
                        Found in DataSource/DataSourceBuilderInterface.php - About 35 mins to fix

                          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  UqlExtensionContainer $extensionContainer,
                                  DataSourceInterface $dataSource,
                                  FilterConditionFactory $filterConditionFactory,
                                  ContextFactory $contextFactory,
                                  $caseSensitive = true
                          Severity: Minor
                          Found in UQL/Interpreter.php - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language