Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

Function create has a Cognitive Complexity of 11 (exceeds 5 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

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 iterate has 31 lines of code (exceeds 25 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 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

      Method getCookieHeader has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
          {
              $cookie = sprintf('%s=%s', $name, urlencode($value));
      
              if (0 !== $expires) {
      Severity: Minor
      Found in src/DebugBar/Collector/BootPress.php - About 1 hr to fix

        Method collect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function collect()
            {
                $messages = array();
                $files = array_values(DebugBar::get('files'));
                $offset = 0;
        Severity: Minor
        Found in src/DebugBar/Collector/Files.php - About 1 hr to fix

          Method login has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function login($user_id, $expires = 7200, $single = false)
              {
                  if (empty($user_id)) {
                      return;
                  }
          Severity: Minor
          Found in src/Auth/Component.php - About 1 hr to fix

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

                public function convert($value, $unit = null)
                {
                    if (is_null($unit)) {
                        return array(
                            'km' => $this->convert($value, 'km'),
            Severity: Minor
            Found in src/Geo/Component.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 collect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function collect()
                {
                    $time = DebugBar::$debugbar->hasCollector('time') ? DebugBar::$debugbar['time'] : false;
                    $templates = Theme::$templates;
                    $data = array(
            Severity: Minor
            Found in src/DebugBar/Collector/Twig.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 image has a Cognitive Complexity of 10 (exceeds 5 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: Minor
            Found in src/Admin/Files.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 collect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function collect()
                {
                    // return array();
            
                    $responseHeaders = $this->response->headers->all();
            Severity: Minor
            Found in src/DebugBar/Collector/BootPress.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 collect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function collect()
                {
                    $messages = array();
                    $files = array_values(DebugBar::get('files'));
                    $offset = 0;
            Severity: Minor
            Found in src/DebugBar/Collector/Files.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 mkpath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                private function mkpath($dir)
                {
                    $path = $this->dir.$dir;
                    if (!is_dir($path)) {
                        $str = '';
            Severity: Minor
            Found in src/Unzip/Component.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 uncompress has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function uncompress($content, $mode, $uncompressed_size, $target_file_name)
                {
                    switch ($mode) {
                        case 0:
                            return ($target_file_name) ? file_put_contents($target_file_name, $content) : $content;
            Severity: Minor
            Found in src/Unzip/Component.php - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if (isset($get['file']) || (isset($get['db']) && (isset($get['mssql']) || isset($get['server']) || isset($get['sqlite']) || isset($get['oracle']) || isset($get['pgsql'])))) {
                          include 'databases/adminer_object.php';
                          include 'databases/adminer-4.2.5-en.php';
                          exit;
                      }
              Severity: Major
              Found in src/Admin/Pages/Databases.php - About 1 hr to fix

                Function resource has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static function resource($path)
                    {
                        if (preg_match('/\.(jpg|jpeg|gif|png|ico)$/i', $path) && is_file($path) && ($dimensions = getimagesize($path))) {
                            list($width, $height, $type) = $dimensions;
                            switch ($type) {
                Severity: Minor
                Found in src/Admin/Files.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 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

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

                    private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
                Severity: Major
                Found in src/DebugBar/Collector/BootPress.php - About 50 mins to fix

                  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 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 timeRange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function timeRange($time, $range, $label = '')
                      {
                          // H - hour - 00 to 23
                          // i - minute - 00 to 59
                          // s - second - 00 to 59
                  Severity: Minor
                  Found in src/Admin/Pages/Analytics.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

                  Severity
                  Category
                  Status
                  Source
                  Language