Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

File Users.php has 396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace BootPress\Admin\Pages;

use BootPress\Admin\Component as Admin;
Severity: Minor
Found in src/Admin/Pages/Users.php - About 5 hrs to fix

    File Component.php has 392 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace BootPress\Auth;
    
    use BootPress\Page\Component as Page;
    Severity: Minor
    Found in src/Auth/Component.php - About 5 hrs to fix

      Method robots has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function robots()
          {
              extract(Admin::params('bp', 'blog', 'website', 'page'));
              $page->title = 'Robot Analytics at '.$website;
              $html = '';
      Severity: Major
      Found in src/Admin/Pages/Analytics.php - About 5 hrs to fix

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

            public function __construct(array $options = array())
            {
                extract(array_merge(array(
                    'db' => null,
                    'basic' => null,
        Severity: Major
        Found in src/Auth/Component.php - About 5 hrs to fix

          Function log has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function log()
              {
                  // Get initial values
                  $page = Page::html();
                  $log = array(); // csv lines
          Severity: Minor
          Found in src/Analytics/Component.php - About 5 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 visitors has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function visitors()
              {
                  extract(Admin::params('bp', 'website', 'page', 'path', 'admin'));
                  $page->title = 'Visitors at '.$website;
                  $html = '';
          Severity: Major
          Found in src/Admin/Pages/Analytics.php - About 5 hrs to fix

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

                public static function save(array $files, array $remove = array())
                {
                    $page = Page::html();
                    if (($retrieve = $page->post('retrieve')) && isset($files[$retrieve])) {
                        exit(is_file($files[$retrieve]) ? file_get_contents($files[$retrieve]) : '');
            Severity: Minor
            Found in src/Admin/Files.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 update has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

                public function update($user_id, array $user = array())
                {
                    $update = array();
                    foreach ($user as $key => $value) {
                        switch ($key) {
            Severity: Minor
            Found in src/Auth/Component.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

            Method theme has 118 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function theme($folder)
                {
                    extract(Admin::params('bp', 'page', 'blog'));
                    if ($page->get('delete') == 'theme') {
                        list($dirs, $files) = Files::iterate($folder, 'recursive');
            Severity: Major
            Found in src/Admin/Pages/Themes.php - About 4 hrs to fix

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

                  public function __construct(array $enable = array(), array $messages = array())
                  {
                      if (self::$debugbar) {
                          return;
                      }
              Severity: Major
              Found in src/DebugBar/Component.php - About 4 hrs to fix

                Function robots has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function robots()
                    {
                        extract(Admin::params('bp', 'blog', 'website', 'page'));
                        $page->title = 'Robot Analytics at '.$website;
                        $html = '';
                Severity: Minor
                Found in src/Admin/Pages/Analytics.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

                Method image has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function image($path, $eject = '')
                    {
                        $html = '';
                        $imagick = (extension_loaded('imagick') && class_exists('Imagick')) ? true : false;
                        $types = array('jpg', 'gif', 'png');
                Severity: Major
                Found in src/Admin/Files.php - About 4 hrs to fix

                  Method file has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function file($field, array $options = array())
                      {
                          $page = Page::html();
                  
                          // View
                  Severity: Major
                  Found in src/Upload/Component.php - About 4 hrs to fix

                    Method location has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function location($timezone, $hemisphere = '')
                        {
                            static $timezones = array(
                                'UM12' => 'Baker / Howland Islands',
                                'UM11' => array(
                    Severity: Major
                    Found in src/Analytics/Component.php - About 4 hrs to fix

                      File Component.php has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace BootPress\Unzip;
                      
                      use BootPress\Page\Component as Page;
                      Severity: Minor
                      Found in src/Unzip/Component.php - About 4 hrs to fix

                        Function iterate has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function iterate($path, $recursive = false, $types = null)
                            {
                                $dirs = $files = array();
                                if (is_dir($path)) {
                                    $cut = strlen($path);
                        Severity: Minor
                        Found in src/Admin/Files.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 server has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function server()
                            {
                                extract(Admin::params('bp', 'website', 'page'));
                                $page->title = 'Server Analytics at '.$website;
                                $page->link(array(
                        Severity: Major
                        Found in src/Admin/Pages/Analytics.php - About 3 hrs to fix

                          Method process has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function process()
                              {
                                  $page = Page::html();
                                  $file = $page->file('analytics.csv');
                                  $temp = $page->file('analytics-temp.csv');
                          Severity: Major
                          Found in src/Analytics/Component.php - About 3 hrs to fix

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

                                public function file($field, array $options = array())
                                {
                                    $page = Page::html();
                            
                                    // View
                            Severity: Minor
                            Found in src/Upload/Component.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 loadFileListByEof has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function loadFileListByEof()
                                {
                                    // Check if there's a valid Central Dir signature.
                                    // Let's consider a file comment smaller than 1024 characters...
                                    // Actually, it length can be 65536.. But we're not going to support it.
                            Severity: Major
                            Found in src/Unzip/Component.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language