netdudes/DataSourceryBundle

View on GitHub
UQL/Interpreter.php

Summary

Maintainability
B
6 hrs
Test Coverage

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

      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

        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

        There are no issues that match your filters.

        Category
        Status