atayahmet/glad

View on GitHub

Showing 21 of 21 total issues

File Author.php has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Glad;

use Glad\Interfaces\ConditionsInterface;
Severity: Minor
Found in src/Glad/Author.php - About 7 hrs to fix

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

    class Author
    {
        /**
         * Repository instance
         *
    Severity: Minor
    Found in src/Glad/Author.php - About 5 hrs to fix

      Function setInjectsParameters has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function setInjectsParameters($class, $method, array $parm = [])
          {
              $methods = array('__construct', $method);
              $instance = null;
      
      
      Severity: Minor
      Found in src/Glad/Injector.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 editParameter has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function editParameter($depends, array $params)
          {
              if(count($depends) > 0 && count($params) > 0){
                  foreach ($depends as $key => $value) {
                      if(!preg_match('/array(\s+)\$(.*?)/', $value) && !preg_match('/\$(.*?)(\s+)\=(\s+)(.*?)/', $value)){
      Severity: Minor
      Found in src/Glad/Injector.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 setInjectsParameters has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected static function setInjectsParameters($class, $method, array $parm = [])
          {
              $methods = array('__construct', $method);
              $instance = null;
      
      
      Severity: Minor
      Found in src/Glad/Injector.php - About 1 hr to fix

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

            protected static function loginFromRemember()
            {
                $rememberConf = static::$constants->remember;
        
                if($rememberConf['enabled'] === true) {
        Severity: Minor
        Found in src/Glad/Author.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 setRemember has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected static function setRemember(array $userData)
            {
                $rememberConf = static::$constants->remember;
        
                if($rememberConf['enabled'] === true) {
        Severity: Minor
        Found in src/Glad/Author.php - About 1 hr to fix

          Method editParameter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected static function editParameter($depends, array $params)
              {
                  if(count($depends) > 0 && count($params) > 0){
                      foreach ($depends as $key => $value) {
                          if(!preg_match('/array(\s+)\$(.*?)/', $value) && !preg_match('/\$(.*?)(\s+)\=(\s+)(.*?)/', $value)){
          Severity: Minor
          Found in src/Glad/Injector.php - About 1 hr to fix

            Method logout has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function logout()
                {
                    static::resetCheckVariables();
            
                    $expire = (static::currentTime()-static::$constants->remember['lifetime']);
            Severity: Minor
            Found in src/Glad/Author.php - About 1 hr to fix

              Function setRemember has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected static function setRemember(array $userData)
                  {
                      $rememberConf = static::$constants->remember;
              
                      if($rememberConf['enabled'] === true) {
              Severity: Minor
              Found in src/Glad/Author.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

              Method set has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function set($name = false, $value = false, $lifeTime = '', $path = '/', $domain = '', $secure = false, $httpOnly = false);
              Severity: Major
              Found in src/Glad/Interfaces/CookerInterface.php - About 50 mins to fix

                Method set has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function set($name = false, $value = false, $lifeTime = '', $path = '/', $domain = '.', $secure = false, $httpOnly = false)
                Severity: Major
                Found in src/Glad/Cooker.php - About 50 mins to fix

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

                      public function __construct(Constants $constants, CookerInterface $cooker, Injector $injector, CryptInterface $crypt, DatabaseServiceInterface $databaseService, SessionHandlerInterface $repository, Dispatcher $eventDispatcher)
                  Severity: Major
                  Found in src/Glad/Author.php - About 50 mins to fix

                    Function apply has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function apply(array $user, $cond = array(), Dispatcher $eventDispatcher)
                        {
                            $this->check = true;
                            $this->add($cond);
                            
                    Severity: Minor
                    Found in src/Glad/Conditions.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 has has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function has($keyOrClass)
                        {
                            if(is_object($keyOrClass)) {
                                foreach(self::$container as $key => $class) {
                                    if(is_object($class) && $class instanceof $keyOrClass) {
                    Severity: Minor
                    Found in src/Glad/Injector.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 resolveDbResult has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected static function resolveDbResult($result)
                        {
                            $exception = false;
                    
                            if(!isset($result) || !$result) return [];
                    Severity: Minor
                    Found in src/Glad/Author.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 register has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function register(HashInterface $hash, array $credentials)
                        {
                            static::resetCheckVariables();
                            if(static::guest() === true) {
                                static::checkIdentityAsParameter($credentials);
                    Severity: Minor
                    Found in src/Glad/Author.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 login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function login(HashInterface $hash, array $user, $remember = false)
                        {
                            static::resetCheckVariables();
                            $passField = static::$constants->authFields['password'];
                    
                    
                    Severity: Minor
                    Found in src/Glad/Author.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 bindWhere has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function bindWhere(array $where)
                        {
                            $_where = '';
                    
                            foreach($where as $operator => $w) {
                    Severity: Minor
                    Found in src/Glad/Driver/Adapters/Database/PDOAdapter.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 loginByUserId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function loginByUserId($userId, $remember = false)
                        {
                            static::resetCheckVariables();
                    
                            if(static::check() === true || $userId == null) return static::getInstance();
                    Severity: Minor
                    Found in src/Glad/Author.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