face-orm/face

View on GitHub

Showing 43 of 43 total issues

Function generateEntityRelations has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

    private function generateEntityRelations($path, QueryFace $queryFace, $faceList){
        $str = '';
        foreach($queryFace->getFace()->getElements() as $element){

            /*
Severity: Minor
Found in lib/Face/Sql/Hydrator/Generated/ArrayHydrator.php - About 1 day 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 _prepareOperations has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _prepareOperations($doValues = false)
    {

        $faceLoader = $this->getFace()->getFaceLoader();
        $face = $this->face;
Severity: Minor
Found in lib/Face/Sql/Reader/QueryArrayReader/PreparedFace.php - About 7 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

EntityFaceElement has 38 functions (exceeds 20 allowed). Consider refactoring.
Open

class EntityFaceElement
{

    const RELATION_BELONGS_TO = "belongsTo";
    const RELATION_HAS_ONE = "hasOne";
Severity: Minor
Found in lib/Face/Core/EntityFaceElement.php - About 5 hrs to fix

    Function faceSetter has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        public function faceSetter($path, $value, FaceLoader $faceLoader = null)
        {
    
            // look the type of $needle then dispatch
            if ( $path instanceof \Face\Core\EntityFaceElement) {
    Severity: Minor
    Found in lib/Face/Traits/EntityFaceTrait.php - About 4 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

    Function getSqlString has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getSqlString(QueryInterface $q)
        {
            $path = $this->joinQueryFace->getPath();
            $face = $this->joinQueryFace->getFace();
            try {
    Severity: Minor
    Found in lib/Face/Sql/Query/Clause/Join.php - About 3 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

    Function getColumnsReal has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getColumnsReal(){
    
            if($this->isSilent()){
                return [];
            }
    Severity: Minor
    Found in lib/Face/Sql/Query/SelectBuilder/QueryFace.php - About 3 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 compile has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function compile(){
    
            /* @var $facesToSelect QueryFace[] */
            $facesToSelect["this"] = $this->selectBuilder->getBaseQueryFace();
            $facesToSelect = array_merge($facesToSelect, $this->selectBuilder->getJoins());
    Severity: Major
    Found in lib/Face/Sql/Query/SelectBuilder/LimitOnSubQueryCompiler.php - About 2 hrs to fix

      Method getSqlString has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getSqlString(QueryInterface $q)
          {
              $path = $this->joinQueryFace->getPath();
              $face = $this->joinQueryFace->getFace();
              try {
      Severity: Major
      Found in lib/Face/Sql/Query/Clause/Join.php - About 2 hrs to fix

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

            public function setColumns($columns)
            {
                $this->columns = [];
        
                if(null === $columns){
        Severity: Minor
        Found in lib/Face/Sql/Query/SelectBuilder/QueryFace.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

        Function compile has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            public function compile(){
        
                /* @var $facesToSelect QueryFace[] */
                $facesToSelect["this"] = $this->selectBuilder->getBaseQueryFace();
                $facesToSelect = array_merge($facesToSelect, $this->selectBuilder->getJoins());
        Severity: Minor
        Found in lib/Face/Sql/Query/SelectBuilder/LimitOnSubQueryCompiler.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

        Function read has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            public function read(\PDOStatement $stmt)
            {
        
                $this->unfoundPrecedence=array();
        
        
        Severity: Minor
        Found in lib/Face/Sql/Reader/QueryArrayReader.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 _prepareOperations has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _prepareOperations($doValues = false)
            {
        
                $faceLoader = $this->getFace()->getFaceLoader();
                $face = $this->face;
        Severity: Major
        Found in lib/Face/Sql/Reader/QueryArrayReader/PreparedFace.php - About 2 hrs to fix

          Method generateEntityRelations has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function generateEntityRelations($path, QueryFace $queryFace, $faceList){
                  $str = '';
                  foreach($queryFace->getFace()->getElements() as $element){
          
                      /*
          Severity: Major
          Found in lib/Face/Sql/Hydrator/Generated/ArrayHydrator.php - About 2 hrs to fix

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

                private static function _proccessDumpFaceData($data, $alreadyPrinted, $depth, $maxDepth = 30)
                {
            
                    $nlStr=PHP_EOL;
            
            
            Severity: Minor
            Found in lib/Face/Debugger.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 faceGetter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function faceGetter($needle)
                {
                    
                    // look the type of $needle then dispatch
                    if ( $needle instanceof \Face\Core\EntityFaceElement ) {
            Severity: Minor
            Found in lib/Face/Traits/EntityFaceTrait.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 generateCode has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function generateCode(SelectQuery $FQuery)
                {
            
                    $identityGetter = "\$identityGetter = [];\n";
                    $arrayDefault = "\$data = [];\n";
            Severity: Minor
            Found in lib/Face/Sql/Hydrator/Generated/ArrayHydrator.php - About 1 hr to fix

              Function runOperations has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function runOperations(EntityInterface $instance, $array,InstancesKeeper $instanceKeeper, &$unfound){
              
                      foreach($this->operationsList as $k=> $operation) {
              
              
              
              Severity: Minor
              Found in lib/Face/Sql/Reader/QueryArrayReader/PreparedFace.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 compile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function compile(){
              
                      /* @var $facesToSelect QueryFace[] */
                      $facesToSelect["this"] = $this->selectBuilder->getBaseQueryFace();
                      $facesToSelect = array_merge($facesToSelect, $this->selectBuilder->getJoins());
              Severity: Minor
              Found in lib/Face/Sql/Query/SelectBuilder/StandardCompiler.php - About 1 hr to fix

                Function getSqlString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSqlString(QueryInterface $q)
                    {
                        $table = null;
                        if(is_string($this->fromItem)){
                            $table = $this->fromItem;
                Severity: Minor
                Found in lib/Face/Sql/Query/Clause/From.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 getSqlString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSqlString()
                    {
                        $baseFace = $this->getBaseFace();
                        
                        
                Severity: Minor
                Found in lib/Face/Sql/Query/SimpleUpdate.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

                Severity
                Category
                Status
                Source
                Language