face-orm/face

View on GitHub

Showing 43 of 43 total issues

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

Method faceSetter has 39 lines of code (exceeds 25 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 1 hr to fix

    Method getColumnsReal has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getColumnsReal(){
    
            if($this->isSilent()){
                return [];
            }
    Severity: Minor
    Found in lib/Face/Sql/Query/SelectBuilder/QueryFace.php - About 1 hr to fix

      Function execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute($config = null)
          {
      
              if(null == $config){
                  $pdo = Config::getDefault()->getPdo();
      Severity: Minor
      Found in lib/Face/Sql/Query/FQuery.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 read has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function read(\PDOStatement $stmt)
          {
      
              $this->unfoundPrecedence=array();
      
      
      Severity: Minor
      Found in lib/Face/Sql/Reader/QueryArrayReader.php - About 1 hr to fix

        Method runOperations has 30 lines of code (exceeds 25 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

          Method _proccessDumpFaceData has 30 lines of code (exceeds 25 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

            Method getElement has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getElement($name, $offset = null, &$pieceOfPath = null)
                {
                    
                    if (StringUtils::beginsWith("this.", $name)) {
                        $name = substr($name, 5);
            Severity: Minor
            Found in lib/Face/Core/EntityFace.php - About 1 hr to fix

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

                  protected function __whereINRelationOneIdentifierGetValues($entities, $itsColumn, EntityFaceElement $relatedElement)
                  {
              
                      $values = array();
              
              
              Severity: Minor
              Found in lib/Face/Sql/Query/SelectBuilder.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 getElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getElement($name, $offset = null, &$pieceOfPath = null)
                  {
                      
                      if (StringUtils::beginsWith("this.", $name)) {
                          $name = substr($name, 5);
              Severity: Minor
              Found in lib/Face/Core/EntityFace.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 __doFQLTableNameStatic has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function __doFQLTableNameStatic($path, $token = null, $escape = false)
                  {
                      if (null===$token) {
                          $token=self::$DOT_TOKEN;
                      }
              Severity: Minor
              Found in lib/Face/Sql/Query/FQuery.php - About 55 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 generateCode has a Cognitive Complexity of 9 (exceeds 5 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 55 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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  function __construct($params = array(), FaceLoader $faceLoader = null)
                  {
                      $this->faceLoader = $faceLoader;
              
                      $this->elements = array();
              Severity: Minor
              Found in lib/Face/Core/EntityFace.php - About 55 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 deeply nested control flow statements.
              Open

                                              if ($parentQueryFace->getFace()->getName() === $element->getName()) {
              
                                                  /* @var $parentQueryFace QueryFace */
                                                  // D
                                                  // Look if parent and child refer to the same one
              Severity: Major
              Found in lib/Face/Sql/Hydrator/Generated/ArrayHydrator.php - About 45 mins to fix

                Function compile has a Cognitive Complexity of 8 (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/StandardCompiler.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 getFaceForClass has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getFaceForClass($className)
                    {
                        $face = null;
                
                        if($this->faceClassExists($className)){
                Severity: Minor
                Found in lib/Face/Core/FaceLoader/CachableLoader.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 getFaceForName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getFaceForName($name)
                    {
                        if($this->faceNameExists($name)){
                            return parent::getFaceForName($name);
                        }else{
                Severity: Minor
                Found in lib/Face/Core/FaceLoader/CachableLoader.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 getSqlString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSqlString()
                    {
                        $baseFace = $this->getBaseFace();
                        
                        
                Severity: Minor
                Found in lib/Face/Sql/Query/SimpleInsert.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 debugGetRelatedName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function debugGetRelatedName($e, EntityFace $face)
                    {
                
                        $names=[];
                
                
                Severity: Minor
                Found in lib/Face/Exception/FaceElementDoesntExistsException.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 _includeIdentifiers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _includeIdentifiers(&$columns){
                        foreach($this->face->getElements() as $elm){
                            if($elm->isValue() && $elm->isIdentifier()){
                                $realPath = $this->makePath($elm->getName());
                                if(!isset($columns[$realPath])) {
                Severity: Minor
                Found in lib/Face/Sql/Query/SelectBuilder/QueryFace.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

                Severity
                Category
                Status
                Source
                Language