yeephp/yeephp

View on GitHub

Showing 52 of 52 total issues

File Yee.php has 608 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Yee - a tiny PHP 5 framework
 *
 * @author      Andreas Maier <info@yeephp.com>
Severity: Major
Found in Yee/Yee.php - About 1 day to fix

    Yee has 65 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Yee
    {
        /**
         * @const string
         */
    Severity: Major
    Found in Yee/Yee.php - About 1 day to fix

      Request has 40 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Request
      {
          const METHOD_HEAD = 'HEAD';
          const METHOD_GET = 'GET';
          const METHOD_POST = 'POST';
      Severity: Minor
      Found in Yee/Http/Request.php - About 5 hrs to fix

        Response has 33 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Response implements \ArrayAccess, \Countable, \IteratorAggregate
        {
            /**
             * @var int HTTP status code
             */
        Severity: Minor
        Found in Yee/Http/Response.php - About 4 hrs to fix

          Function setCookieHeader has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function setCookieHeader(&$header, $name, $value)
              {
                  //Build cookie header
                  if (is_array($value)) {
                      $domain = '';
          Severity: Minor
          Found in Yee/Http/Util.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

          Route has 27 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Route
          {
              /**
               * @var string The route pattern (e.g. "/books/:id")
               */
          Severity: Minor
          Found in Yee/Route.php - About 3 hrs to fix

            File Request.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Yee - a tiny PHP 5 framework
             *
             * @author      Andreas Maier <info@yeephp.com>
            Severity: Minor
            Found in Yee/Http/Request.php - About 2 hrs to fix

              Set has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Set implements \ArrayAccess, \Countable, \IteratorAggregate
              {
                  /**
                   * Key-value array of arbitrary data
                   * @var array
              Severity: Minor
              Found in Yee/Helper/Set.php - About 2 hrs to fix

                Function call has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function call()
                    {
                        try {
                            if (isset($this->environment['yee.flash'])) {
                                $this->view()->setData('flash', $this->environment['yee.flash']);
                Severity: Minor
                Found in Yee/Yee.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 readdir has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected static function readdir($dir)
                    {
                        $entries = array();
                        foreach (scandir($dir) as $entry) {
                            if(($entry != '.') && ($entry != '..')){
                Severity: Minor
                Found in Yee/Managers/RoutingCacheManager.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

                Log has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Log
                {
                    const EMERGENCY = 1;
                    const ALERT     = 2;
                    const CRITICAL  = 3;
                Severity: Minor
                Found in Yee/Log.php - About 2 hrs to fix

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

                      public function __construct(array $userSettings = array())
                      {
                          // Setup IoC container
                          $this->container = new \Yee\Helper\Set();
                          $this->container['settings'] = array_merge(static::getDefaultSettings(), $userSettings);
                  Severity: Major
                  Found in Yee/Yee.php - About 2 hrs to fix

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

                        public function post($key = null, $default = null)
                        {
                            if (!isset($this->env['yee.input'])) {
                                throw new \RuntimeException('Missing Yee.input in environment variables');
                            }
                    Severity: Minor
                    Found in Yee/Http/Request.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 log has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function log($level, $object, $context = array())
                        {
                            if (!isset(self::$levels[$level])) {
                                throw new \InvalidArgumentException('Invalid log level supplied to function');
                            } else if ($this->enabled && $this->writer && $level <= $this->level) {
                    Severity: Minor
                    Found in Yee/Log.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 applyHook has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function applyHook($name, $hookArg = null)
                        {
                            if (!isset($this->hooks[$name])) {
                                $this->hooks[$name] = array(array());
                            }
                    Severity: Minor
                    Found in Yee/Yee.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 call has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function call()
                        {
                            try {
                                if (isset($this->environment['yee.flash'])) {
                                    $this->view()->setData('flash', $this->environment['yee.flash']);
                    Severity: Minor
                    Found in Yee/Yee.php - About 1 hr to fix

                      Method setCookieHeader has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function setCookieHeader(&$header, $name, $value)
                          {
                              //Build cookie header
                              if (is_array($value)) {
                                  $domain = '';
                      Severity: Minor
                      Found in Yee/Http/Util.php - About 1 hr to fix

                        Function processClass has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function processClass($classFile)
                            {
                                $className = '';
                                $content   = file_get_contents($classFile);
                                $result    = '';
                        Severity: Minor
                        Found in Yee/Managers/RoutingCacheManager.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 getMatchedRoutes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getMatchedRoutes($httpMethod, $resourceUri, $reload = false)
                            {
                                if ($reload || is_null($this->matchedRoutes)) {
                                    $this->matchedRoutes = array();
                                    foreach ($this->routes as $route) {
                        Severity: Minor
                        Found in Yee/Router.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 processClass has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function processClass($classFile)
                            {
                                $className = '';
                                $content   = file_get_contents($classFile);
                                $result    = '';
                        Severity: Minor
                        Found in Yee/Managers/RoutingCacheManager.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language