gjerokrsteski/pimf-framework

View on GitHub

Showing 34 of 37 total issues

ResponseStatus has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class ResponseStatus
{
    /**
     * Name and revision of the information protocol
     *
Severity: Minor
Found in core/Pimf/Util/Header/ResponseStatus.php - About 3 hrs to fix

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

        public function render()
        {
            if (Sapi::isCli() && Config::get('environment') == 'production') {
                $suffix = 'CliAction';
                $action = $this->request->fromCli()->get('action', 'index');
    Severity: Minor
    Found in core/Pimf/Controller/Base.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 initCliAction has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function initCliAction()
        {
            clearstatcache();
    
            $app = 'app/' . Config::get('app.name') . '/';
    Severity: Minor
    Found in core/Pimf/Controller/Core.php - About 1 hr to fix

      Method format has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function format(\Exception $exception, $isCli = false)
          {
              if ($isCli === true) {
                  return
                      "+++ Untreated Exception +++" . PHP_EOL . "Message: " . $exception->getMessage() . PHP_EOL . "Location: " . $exception->getFile()
      Severity: Minor
      Found in core/Pimf/Error.php - About 1 hr to fix

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

            public static function fire($events, $parameters = array(), $halt = false)
            {
                $responses = array();
                $parameters = (array)$parameters;
        
        
        Severity: Minor
        Found in core/Pimf/Event.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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function render()
            {
                if (Sapi::isCli() && Config::get('environment') == 'production') {
                    $suffix = 'CliAction';
                    $action = $this->request->fromCli()->get('action', 'index');
        Severity: Minor
        Found in core/Pimf/Controller/Base.php - About 1 hr to fix

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

              public function init()
              {
                  //convert URL params into regex patterns, construct a regex for this route, load params
                  $regex = preg_replace_callback(
                      '#:([\w]+)\+?#', array($this, 'computeUrlRegex'), str_replace(')', ')?', (string)$this->rule)
          Severity: Minor
          Found in core/Pimf/Route.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 setupUtils has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function setupUtils(array $server, $tmpPath, $logging = 'file')
              {
                  self::$env = new Environment($server);
                  $envData = self::$env->data();
          
          
          Severity: Minor
          Found in core/Pimf/Application.php - About 1 hr to fix

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

                public function __construct(\Pimf\Request $request, $repositoryPath = '/Controller', $prefix = 'Pimf\\', $router)
                {
                    $controllerName = $request->fromGet()->get('controller');
                    $this->router = $router;
            
            
            Severity: Minor
            Found in core/Pimf/Resolver.php - About 1 hr to fix

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

                  public static function run(array $get, array $post, array $cookie, array $files)
                  {
                      $cli = array();
                      if (Sapi::isCli()) {
                          $cli = Cli::parse((array)self::$env->argv);
              Severity: Minor
              Found in core/Pimf/Application.php - About 1 hr to fix

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

                    public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
                Severity: Major
                Found in core/Pimf/Error.php - About 50 mins to fix

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

                      protected static function view($code, $status, $exit = true)
                      {
                          if (Sapi::isCli()) {
                              echo $status . PHP_EOL;
                              if ($exit) {
                  Severity: Minor
                  Found in core/Pimf/Util/Header.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

                  Method put has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function put($name, $value, $expiration = 0, $path = '/', $domain = null, $secure = false)
                  Severity: Minor
                  Found in core/Pimf/Cookie.php - About 45 mins to fix

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

                            Request $request,
                            Response $response = null,
                            Logger $logger,
                            $em,
                            Router $router,
                    Severity: Minor
                    Found in core/Pimf/Controller/Base.php - About 45 mins to fix

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

                          public function __construct(\Pimf\Request $request, $repositoryPath = '/Controller', $prefix = 'Pimf\\', $router)
                          {
                              $controllerName = $request->fromGet()->get('controller');
                              $this->router = $router;
                      
                      
                      Severity: Minor
                      Found in core/Pimf/Resolver.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

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

                              array $getData,
                              array $postData = array(),
                              array $cookieData = array(),
                              array $cliData = array(),
                              array $filesData = array(),
                      Severity: Minor
                      Found in core/Pimf/Request.php - About 45 mins to fix

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

                            public function __construct($path, $name, $mime = null, $size = null, $error = null, $test = false)
                        Severity: Minor
                        Found in core/Pimf/Util/Uploaded.php - About 45 mins to fix

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

                              public static function run(array $get, array $post, array $cookie, array $files)
                              {
                                  $cli = array();
                                  if (Sapi::isCli()) {
                                      $cli = Cli::parse((array)self::$env->argv);
                          Severity: Minor
                          Found in core/Pimf/Application.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

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

                              public static function forever($name, $value, $path = '/', $domain = null, $secure = false)
                          Severity: Minor
                          Found in core/Pimf/Cookie.php - About 35 mins to fix

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

                                public static function exception(\Exception $exception, Logger $logger, $exit = true)
                                {
                                    static::log($exception, $logger);
                            
                                    ob_get_length() > 0 && ob_get_level() && ob_end_clean();
                            Severity: Minor
                            Found in core/Pimf/Error.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