Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

File wyciwyg.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* From: Alex Brem @ http://blog.0xab.cd - fieldSelection jQuery plugin */
(function() {
    var fieldSelection = {
        getSelection: function() {
            var e = (this.jquery) ? this[0] : this;
Severity: Minor
Found in src/Admin/Pages/admin/wyciwyg.js - About 2 hrs to fix

    Method pages has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function pages()
        {
            extract(Admin::params('bp', 'website', 'page', 'path', 'admin'));
            $page->title = 'Analytic Pages at '.$website;
            $url = $page->url($admin, $path, 'users'); // for linking most recent users
    Severity: Major
    Found in src/Admin/Pages/Analytics.php - About 2 hrs to fix

      Method page has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function page()
          {
              extract(Admin::params('bp', 'blog', 'auth', 'page', 'admin', 'path', 'method'));
              if ($method) {
                  switch ($method) {
      Severity: Major
      Found in src/Admin/Pages/Blog.php - About 2 hrs to fix

        Function collect has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public function collect()
            {
                $logs = array(
                    'nb_databases' => 0,
                    'nb_statements' => 0,
        Severity: Minor
        Found in src/DebugBar/Collector/Queries.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

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

            private static function editUser($user_id)
            {
                extract(Admin::params('bp', 'page', 'auth', 'website'));
                $page->title = 'Edit User at '.$website;
                $html = '';
        Severity: Major
        Found in src/Admin/Pages/Users.php - About 2 hrs to fix

          Method update has 50 lines of code (exceeds 25 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 2 hrs to fix

            Method __call has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __call($method, $arguments)
                {
                    switch ($method) {
                        case 'start':
                            if (self::$debugbar->hasCollector('time')) {
            Severity: Minor
            Found in src/DebugBar/Component.php - About 1 hr to fix

              Method restore has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private static function restore()
                  {
                      extract(Admin::params('bp', 'page', 'blog', 'website'));
                      $page->title = 'Restore Blog at '.$website;
                      $html = '';
              Severity: Minor
              Found in src/Admin/Pages/Blog.php - About 1 hr to fix

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

                    private static function listUsers($view)
                    {
                        extract(Admin::params('bp', 'page', 'auth', 'website'));
                        $page->title = 'View Users at '.$website;
                        $html = '';
                Severity: Minor
                Found in src/Admin/Pages/Users.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 referrers has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function referrers()
                    {
                        extract(Admin::params('bp', 'website', 'page'));
                        $page->title = 'Referrer Analytics at '.$website;
                        $db = BPA::database();
                Severity: Minor
                Found in src/Admin/Pages/Analytics.php - About 1 hr to fix

                  Method getFileHeader has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function getFileHeader($start_offset = false)
                      {
                          if ($start_offset !== false) {
                              fseek($this->fh, $start_offset);
                          }
                  Severity: Minor
                  Found in src/Unzip/Component.php - About 1 hr to fix

                    Method box has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function box($style, array $contents)
                        {
                            $box = '';
                            $classes = 'box box-'.implode(' box-', explode(' ', $style)); // solid, default, primary, info, warning, success, danger
                            foreach ($contents as $section => $value) {
                    Severity: Minor
                    Found in src/Admin/Component.php - About 1 hr to fix

                      Method sessions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function sessions($user_id)
                          {
                              extract(Admin::params('bp', 'page', 'auth'));
                              $html = '';
                              if (!$bp->pagination->set('sessions', 10)) {
                      Severity: Minor
                      Found in src/Admin/Pages/Users.php - About 1 hr to fix

                        Method editProfile has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function editProfile($user_id)
                            {
                                extract(Admin::params('bp', 'page', 'auth', 'website'));
                                $page->title = 'Edit Your Profile at '.$website;
                                $html = '';
                        Severity: Minor
                        Found in src/Admin/Pages/Users.php - About 1 hr to fix

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

                              private static function restore()
                              {
                                  extract(Admin::params('bp', 'page', 'blog', 'website'));
                                  $page->title = 'Restore Blog at '.$website;
                                  $html = '';
                          Severity: Minor
                          Found in src/Admin/Pages/Blog.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 debugbar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function debugbar($action, $params = null)
                              {
                                  static $debugbar = null;
                                  $params = func_get_args();
                                  $action = (string) array_shift($params);
                          Severity: Minor
                          Found in src/DebugBar/function.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 setup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function setup($auth, $path)
                              {
                                  if (!$auth->isAdmin(2)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in src/Admin/Pages/Blog.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 setup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function setup($auth, $path)
                              {
                                  if (!$auth->isAdmin(2)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in src/Admin/Pages/Blog.php - About 1 hr to fix

                            Method create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private static function create()
                                {
                                    $html = '';
                                    extract(Admin::params('bp', 'page', 'blog'));
                                    $form = $bp->form('admin_theme_create');
                            Severity: Minor
                            Found in src/Admin/Pages/Themes.php - About 1 hr to fix

                              Method startStop has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function startStop($count, $range, $label = 'Y-m-d H:i:s', array $values = array())
                                  {
                                      $array = array();
                                      $range = substr($range, 0, 3);
                                      if (in_array($range, array('sec', 'min', 'hou', 'day', 'wee', 'mon', 'yea'))) {
                              Severity: Minor
                              Found in src/Admin/Pages/Analytics.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language