Kylob/BootPress

View on GitHub
src/Admin/Pages/Users.php

Summary

Maintainability
F
3 days
Test Coverage

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

    Method listUsers has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      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

        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 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

            Method signIn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function signIn()
                {
                    extract(Admin::params('bp', 'page', 'auth', 'path'));
                    $page->title = 'Sign In for Admin Users';
                    $html = '';
            Severity: Minor
            Found in src/Admin/Pages/Users.php - About 1 hr to fix

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

                  public static function page()
                  {
                      extract(Admin::params('bp', 'page', 'auth', 'path', 'method'));
                      switch ($method) {
                          case 'logout':
              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 registerUser has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

                    public static function page()
                    {
                        extract(Admin::params('bp', 'page', 'auth', 'path', 'method'));
                        switch ($method) {
                            case 'logout':
                Severity: Minor
                Found in src/Admin/Pages/Users.php - About 1 hr to fix

                  Method setup has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function setup($auth, $path)
                      {
                          extract(Admin::params('bp', 'page'));
                          static::$icon = $bp->icon('user', 'glyphicon', 'span style="margin-right:10px;"').' ';
                          if ($user = $auth->http()) {
                  Severity: Minor
                  Found in src/Admin/Pages/Users.php - About 1 hr to fix

                    Function editUser has a Cognitive Complexity of 9 (exceeds 5 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: Minor
                    Found in src/Admin/Pages/Users.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

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

                        private static function signIn()
                        {
                            extract(Admin::params('bp', 'page', 'auth', 'path'));
                            $page->title = 'Sign In for Admin Users';
                            $html = '';
                    Severity: Minor
                    Found in src/Admin/Pages/Users.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 sessions has a Cognitive Complexity of 8 (exceeds 5 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 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 editProfile has a Cognitive Complexity of 7 (exceeds 5 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 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

                    There are no issues that match your filters.

                    Category
                    Status