Showing 120 of 120 total issues

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

    public function mapPreload($side, $property, $result, $plan, $loader);
Severity: Minor
Found in src/PHPixie/ORM/Relationships/Relationship/Handler/Preloading.php - About 35 mins to fix

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

        public function prepareNode($id, $left, $rootId, $innerWidth, $depth)
    Severity: Minor
    Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/MoveChild.php - About 35 mins to fix

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

          public function __construct($values, $queryMapper, $queryPropertyMap, $container, $config)
      Severity: Minor
      Found in src/PHPixie/ORM/Models/Type/Database/Implementation/Query.php - About 35 mins to fix

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

            protected function processRange($left, $right)
            {
                $key = $this->insertRange($left, $right);
                if($left + 1 == $right) {
                    return true;
        Severity: Minor
        Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/AssertSafeDelete.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 asObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function asObject($recursive = false)
            {
                $this->requirePropertyNames();
                    
                $data = $this->data->data();
        Severity: Minor
        Found in src/PHPixie/ORM/Models/Model/Implementation/Entity.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 handleDelete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handleDelete($side, $reusableResult, $plan, $sidePath)
            {
                $config = $side->config();
                $itemKey = $config->ownerKey;
                $itemModel = $config->itemModel;
        Severity: Minor
        Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.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 resetProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function resetProperties($side, $items)
            {
                $opposing = $this->getOpposing($side->type());
                $itemsProperty = $side->config()->get($opposing.'Property');
        
        Severity: Minor
        Found in src/PHPixie/ORM/Relationships/Type/ManyToMany/Handler.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 false;
        Severity: Major
        Found in src/PHPixie/ORM/Mappers/Conditions/Optimizer.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $entity;
          Severity: Major
          Found in src/PHPixie/ORM/Loaders/Loader/Proxy/Editable.php - About 30 mins to fix

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

                protected function appendToCurrent($value, $key = null)
                {
                    if($key === null){
                        $this->currentArray[] = $value;
            
            Severity: Minor
            Found in src/PHPixie/ORM/Data/Types/Document/Node/ArrayNode.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 remove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function remove($entities)
                {
                    foreach ($entities as $entity) {
                        $id = $entity->id();
                        $this->skipId($id);
            Severity: Minor
            Found in src/PHPixie/ORM/Loaders/Loader/Proxy/Editable.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 getAdjustment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getAdjustment($offset)
                {
                    $low = 0;
                    $count = count($this->existingBefore);
                    $high =  $count - 1;
            Severity: Minor
            Found in src/PHPixie/ORM/Loaders/Loader/Proxy/Editable.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 merge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function merge($left, $right)
                {
                    if(count($right) !== 1)
                        return $this->mergeConditions($left, $right);
                    
            Severity: Minor
            Found in src/PHPixie/ORM/Mappers/Conditions/Optimizer.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 getArrayNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getArrayNode($document, $path, $createMissing = false)
                {
                    list($parent, $key) = $this->getParentDocumentAndKey($document, $path);
                    if($document === null)
                        return null;
            Severity: Minor
            Found in src/PHPixie/ORM/Planners/Planner/Document.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 validateSubtree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function validateSubtree($data)
                {
                    $leftKey = $this->config->leftKey;
                    $rightKey = $this->config->rightKey;
            
            
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/AssertSafeDelete.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 usedConnections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function usedConnections()
                {
                    $connections = array();
                    foreach ($this->steps() as $step) {
                        foreach($step->usedConnections() as $connection) {
            Severity: Minor
            Found in src/PHPixie/ORM/Plans/Plan.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 mapCommon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function mapCommon($query, $databaseQuery, $queryPlan)
                {
                    $modelName           = $query->modelName();
                    $conditions          = $query->getConditions();
                    $requiredPlan        = $queryPlan->requiredPlan();
            Severity: Minor
            Found in src/PHPixie/ORM/Mappers/Query.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 isExpandable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function isExpandable($group, $minPrecedance)
                {
                    $conditions = $group->conditions();
                    foreach($conditions as $key => $condition){
                        if($key == 0)
            Severity: Minor
            Found in src/PHPixie/ORM/Mappers/Conditions/Optimizer.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 addSide has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function addSide($side)
                {
                    if($side instanceof \PHPixie\ORM\Relationships\Relationship\Side\Relationship) {
                        $this->mapInstances['relationship']->add($side);
                    }
            Severity: Minor
            Found in src/PHPixie/ORM/Maps.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 asArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function asArray($entitiesAsObjects = false, $keyField = null)
                {
                    $array = array();
                    $withKey = $keyField === null;
            
            
            Severity: Minor
            Found in src/PHPixie/ORM/Loaders/Loader.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