netdudes/DataSourceryBundle

View on GitHub

Showing 42 of 42 total issues

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

    public function __construct($unexpectedTokenName, $unexpectedTokenValue, array $expectedTokenCategories, array $parsedTokenStream, $message = null)
Severity: Minor
Found in UQL/Exception/Semantic/UqlUnexpectedTokenException.php - About 35 mins to fix

    Function matchAssertion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function matchAssertion()
        {
            $identifier = $this->nextToken();
    
            if ($identifier['token'] != 'T_IDENTIFIER') {
    Severity: Minor
    Found in UQL/Parser.php - About 35 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 toUQL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function toUQL()
        {
            $numericMethods = [
                self::METHOD_NUMERIC_EQ,
                self::METHOD_NUMERIC_GT,
    Severity: Minor
    Found in Query/FilterCondition.php - About 35 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 fetchData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function fetchData(QueryBuilder $queryBuilder, Query $query, DataSourceInterface $dataSource)
        {
            $fields = $dataSource->getFields();
            $rowCollection = [];
            $queryResults = $queryBuilder->getQuery()->getResult();
    Severity: Minor
    Found in DataSource/Driver/Doctrine/DoctrineDriver.php - About 35 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 matchConcatenation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function matchConcatenation()
        {
            $elements = [];
    
            $firstStatement = $this->matchStatement();
    Severity: Minor
    Found in UQL/Parser.php - About 35 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 getValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getValue(ASTAssertion $astSubtree)
        {
            $value = $astSubtree->getValue();
            $operator = $astSubtree->getOperator();
    
    
    Severity: Minor
    Found in UQL/Interpreter.php - About 35 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 translateOperator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function translateOperator($token, FieldInterface $dataSourceElement)
        {
            $translationTable = [
                "T_OP_LT" => [
                    FilterCondition::METHOD_NUMERIC_LT,
    Severity: Minor
    Found in UQL/Interpreter.php - About 35 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 generateJoinDependencyTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function generateJoinDependencyTree(array $elements)
        {
            $subtree = [];
            foreach ($elements as $element) {
                $parts = explode('.', $element, 2);
    Severity: Minor
    Found in DataSource/Driver/Doctrine/QueryBuilder/JoinGenerator.php - About 35 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

    Avoid too many return statements within this method.
    Open

                    return new SearchTextDataType();
    Severity: Major
    Found in DataSource/DataSourceBuilder.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $this->buildExpressionForCollection($filterCondition, $identifier, $token, $queryBuilder);
      Severity: Major
      Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return new PercentDataType();
        Severity: Major
        Found in DataSource/DataSourceBuilder.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $queryBuilder->expr()->lte($identifier, $token);
          Severity: Major
          Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return new EntityDataType();
            Severity: Major
            Found in DataSource/DataSourceBuilder.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $queryBuilder->expr()->lt($identifier, $token);
              Severity: Major
              Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $queryBuilder->expr()->gte($identifier, $token);
                Severity: Major
                Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $queryBuilder->expr()->neq($identifier, $token);
                  Severity: Major
                  Found in DataSource/Driver/Doctrine/QueryBuilder/Filterer.php - About 30 mins to fix

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

                        private function extractTransformerRequiredFields(array $transformers)
                        {
                            $transformersRequiredFields = [];
                            foreach ($transformers as $transformer) {
                                foreach ($transformer->getRequiredFieldNames() as $fieldName) {
                    Severity: Minor
                    Found in DataSource/Driver/Doctrine/QueryBuilder/RequiredFieldsExtractor.php - About 25 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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function handle(Filter $filter, array $dataSourceFields)
                        {
                            foreach ($filter as $index => $subFilterOrFilterCondition) {
                                if ($subFilterOrFilterCondition instanceof Filter) {
                                    $this->handle($subFilterOrFilterCondition, $dataSourceFields);
                    Severity: Minor
                    Found in Query/SearchTextFieldHandler.php - About 25 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 createFromJsonSerializable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function createFromJsonSerializable($jsonSerializable)
                        {
                            @trigger_error('createFromJsonSerializable() is deprecated and will be removed in 1.0.0. It seems to be unused.', E_USER_DEPRECATED);
                    
                            if (!count((array) $jsonSerializable)) {
                    Severity: Minor
                    Found in Query/Filter.php - About 25 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 matchArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function matchArray()
                        {
                            $token = $this->nextToken();
                            if ($token['token'] != "T_ARRAY_OPEN") {
                                $this->rewindToken();
                    Severity: Minor
                    Found in UQL/Parser.php - About 25 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

                    Severity
                    Category
                    Status
                    Source
                    Language