piotrpolak/pepiscms

View on GitHub

Showing 481 of 486 total issues

Method genericthumb has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function genericthumb($absolute = false, $size = 50, $current_path = false)
    {
        if (!$current_path) {
            $start_word = 'thumb';
            $pos = strpos($_SERVER['REQUEST_URI'], $start_word);
Severity: Major
Found in pepiscms/application/controllers/admin/Ajaxfilemanager.php - About 2 hrs to fix

    PagesAdmin has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class PagesAdmin extends ModuleAdminController
    {
        /**
         * Base path for file uploads
         *
    Severity: Minor
    Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 2 hrs to fix

      Function toggleOverlay has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          toggleOverlay: function (el, trigger) {
              var html = '<div class="overlay_mask" style="display: none;"></div><div class="overlay_window">';
              html += '<div class="box_content">';
              html += '<h4>';
              html += '<a href="#" class="trigger close_overlay">';
      Severity: Major
      Found in pepiscms/js/popup.js - About 2 hrs to fix

        Method importFrameworkLogs has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function importFrameworkLogs()
            {
                // Reading logs from the given location
                $log_path = $this->config->item('log_path');
                $logs = glob($log_path . '*.php');
        Severity: Major
        Found in pepiscms/application/models/Log_model.php - About 2 hrs to fix

          Method applyFilters has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function applyFilters($db, $filters)
              {
                  $allowed_conditions = array(
                      'eq' => '=',
                      'ne' => '!=',
          Severity: Major
          Found in pepiscms/application/models/Generic_model.php - About 2 hrs to fix

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

                public function __construct($render_menu = true, $skip_authorization = false)
                {
                    parent::__construct();
            
                    $this->benchmark->mark('admin_controller_construct_start');
            Severity: Major
            Found in pepiscms/application/classes/AdminController.php - About 2 hrs to fix

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

                  public static function encodeFiltersString($filters)
                  {
                      if (!is_array($filters)) {
                          return false;
                      }
              Severity: Minor
              Found in pepiscms/application/libraries/DataGrid.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

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

                  public function register($display_name, $user_email, $user_login = false, $password = false, $group_ids = array(), $is_root = false, $send_email_notification = true, $data = array(), $account_type = 0)
                  {
                      // If there is no password specified, lets generate one for the user
                      if (!$password) {
                          $password = $this->generateEasyPassword($this->getMinimumAllowedPasswordLenght() + 2);
              Severity: Minor
              Found in pepiscms/application/models/User_model.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

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

                  public function generateXML($feed, $headers = false, $file_name = false, $send = true, $root_name = false, $item_name = false)
                  {
                      if (!$file_name) {
                          $file_name = 'spreadsheet-' . date('Y-m-d-h-i-s') . '.xml';
                      }
              Severity: Minor
              Found in pepiscms/application/libraries/Spreadsheet.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

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

                  public function getFiltersForDataFeed()
                  {
                      $pairs = $this->getFilterPairs();
              
                      $applied_filter_values = array(); // For links and user interface
              Severity: Minor
              Found in pepiscms/application/libraries/DataGrid.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

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

                  public function saveAllConfigurationVariables($data)
                  {
                      $known_config_data = (array)$this->getAllConfigurationVariables();
              
                      $data = array_merge($known_config_data, $data);
              Severity: Minor
              Found in pepiscms/application/models/Siteconfig_model.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

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

                  private function genericthumb($absolute = false, $size = 50, $current_path = false)
                  {
                      if (!$current_path) {
                          $start_word = 'thumb';
                          $pos = strpos($_SERVER['REQUEST_URI'], $start_word);
              Severity: Minor
              Found in pepiscms/application/controllers/admin/Ajaxfilemanager.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

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

                  public function __construct($render_menu = true, $skip_authorization = false)
                  {
                      parent::__construct();
              
                      $this->benchmark->mark('admin_controller_construct_start');
              Severity: Minor
              Found in pepiscms/application/classes/AdminController.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

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

                  protected function tailAFile($path, $count = 10)
                  {
                      if (!file_exists($path)) {
                          return false;
                      }
              Severity: Minor
              Found in pepiscms/modules/symfony2_bridge/models/Symfony2_log_model.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

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

                  public function deletemenuelement()
                  {
                      $item_id = $this->input->getParam('item_id');
              
                      $success = false;
              Severity: Minor
              Found in pepiscms/modules/pages/controllers/PagesAdmin.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 _run_hook has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _run_hook($data)
                  {
                      // Closures/lambda functions and array($object, 'method') callables
                      if (is_callable($data)) {
                          is_array($data)
              Severity: Major
              Found in pepiscms/application/core/PEPISCMS_Hooks.php - About 2 hrs to fix

                Method import has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function import()
                    {
                        if (!$this->isImportable()) {
                            show_404();
                        }
                Severity: Major
                Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 2 hrs to fix

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

                      public function generateXML($feed, $headers = false, $file_name = false, $send = true, $root_name = false, $item_name = false)
                      {
                          if (!$file_name) {
                              $file_name = 'spreadsheet-' . date('Y-m-d-h-i-s') . '.xml';
                          }
                  Severity: Major
                  Found in pepiscms/application/libraries/Spreadsheet.php - About 2 hrs to fix

                    File LogsAdmin.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     * PepisCMS
                     *
                    Severity: Minor
                    Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 2 hrs to fix

                      File PEPISCMS_Loader.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * PepisCMS
                       *
                      Severity: Minor
                      Found in pepiscms/application/core/PEPISCMS_Loader.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language