Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

Function display_wyciwyg has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function display_wyciwyg (classes, data, retrieve, file, line, col) {
Severity: Minor
Found in src/Admin/Pages/admin/wyciwyg.js - About 45 mins to fix

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

        public function extractFiles($files)
        {
            $file_locations = array();
            foreach ((array) $files as $extract) {
                foreach ($this->files() as $file) {
    Severity: Minor
    Found in src/Unzip/Component.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

    Method getFileName has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload)
    Severity: Minor
    Found in src/Upload/FileName.php - About 45 mins to fix

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

          public function extract($allow_extensions = null, $remove_common_dir = false)
          {
              $locations = array();
              $files = $this->files();
              $start = $remove_common_dir ? mb_strlen(Page::html()->commonDir($files)) : 0;
      Severity: Minor
      Found in src/Unzip/Component.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 page has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function page()
          {
              extract(Admin::params('page', 'blog', 'bp'));
              if ($edit = $page->get('edit')) {
                  // enforce only one folder path ie. no subfolders
      Severity: Minor
      Found in src/Admin/Pages/Themes.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 next has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function next(&$delayed, $time)
          {
              $html = '-';
              if (!empty($delayed)) {
                  $delay = $delayed - $time;
      Severity: Minor
      Found in src/Admin/Pages/Analytics.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

      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

      Function check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function check($email, $password = null, $and = null)
          {
              $check = func_get_args();
              $email = array_shift($check);
              if (empty($check)) {
      Severity: Minor
      Found in src/Auth/Component.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

      Avoid too many return statements within this method.
      Open

                  return $page->sendJson($data);
      Severity: Major
      Found in src/Admin/Files.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return ($target_file_name) ? file_put_contents($target_file_name, bzdecompress($content)) : bzdecompress($content);
        Severity: Major
        Found in src/Unzip/Component.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $this->setError('IBM TERSE is not supported... yet?');
          Severity: Major
          Found in src/Unzip/Component.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $ret;
            Severity: Major
            Found in src/Unzip/Component.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return ($convert == 'Kilometers') ? $value * 1.60934 : $value * 0.868976; // else Nautical Miles
              Severity: Major
              Found in src/Geo/Component.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $this->setError('Enhanced Deflating is not supported... yet?');
                Severity: Major
                Found in src/Unzip/Component.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $this->setError('PKWARE Date Compression Library Impoloding is not supported... yet?');
                  Severity: Major
                  Found in src/Unzip/Component.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return ($convert == 'Kilometers') ? $value * 1.852 : $value * 1.15078; // else Miles
                    Severity: Major
                    Found in src/Geo/Component.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return $this->setError('Unknown uncompress method: '.$mode);
                      Severity: Major
                      Found in src/Unzip/Component.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $this->setError('Tokenizing compression algorithm is not supported... yet?');
                        Severity: Major
                        Found in src/Unzip/Component.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return '<div id="admin_manage_files">'.$files.'</div><br>'.$form;
                          Severity: Major
                          Found in src/Admin/Files.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return ($target_file_name) ? file_put_contents($target_file_name, gzinflate($content, $uncompressed_size)) : gzinflate($content, $uncompressed_size);
                            Severity: Major
                            Found in src/Unzip/Component.php - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language