piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

Function makeUserSpaceModule has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    public function makeUserSpaceModule($module_database_table_name,
                                        $module_name,
                                        $auto_install = true,
                                        $parse_database_schema = true,
                                        $database_group = false,
Severity: Minor
Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 6 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

DataGrid has 48 functions (exceeds 20 allowed). Consider refactoring.
Open

class DataGrid extends ContainerAware
{
    /**
     * Basic search filter
     */
Severity: Minor
Found in pepiscms/application/libraries/DataGrid.php - About 6 hrs to fix

    Generic_model has 48 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Generic_model extends PEPISCMS_Model implements EntitableInterface, MoveableInterface, AdvancedDataFeedableInterface
    {
        /**
         * Database table name
         *
    Severity: Minor
    Found in pepiscms/application/models/Generic_model.php - About 6 hrs to fix

      Function _datagrid_format_id_metadata_column has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _datagrid_format_id_metadata_column($content, &$line)
          {
              // TODO move HTML out of this method
      
              // $content is usually meta_order_field
      Severity: Minor
      Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 6 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 generate has 159 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function generate($extra_param = false)
          {
              $output = '';
      
              $page = $this->input->getParam('page');
      Severity: Major
      Found in pepiscms/application/libraries/DataGrid.php - About 6 hrs to fix

        ModuleGenerator has 45 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ModuleGenerator extends ContainerAware
        {
            /**
             * @var \PiotrPolak\PepisCMS\Modulerunner\ModuleLocatorInterface
             */
        Severity: Minor
        Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 6 hrs to fix

          Function FileManagerUI has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

          function FileManagerUI(transtlation_map, is_intranet) {
          
              var current_path = '/';
              var parent_path = '';
              var allowed_extensions = []; // Must be an array
          Severity: Minor
          Found in pepiscms/js/ajaxfilemanager.js - About 6 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 move has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              public function move($id, $direction, $table = false, $constraint_field_name = false,
                                   $item_order_field_name = 'item_order', $id_field_name = 'id')
              {
                  // When no table is specified, taking table from the object
                  if (!$table) {
          Severity: Minor
          Found in pepiscms/application/models/Generic_model.php - About 5 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 __construct has 141 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  parent::__construct();
          
                  $lang_field_prefix = $this->module_name . '_';
          Severity: Major
          Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 5 hrs to fix

            File Installer.php has 400 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * PepisCMS
             *
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Installer.php - About 5 hrs to fix

              Function parseCommandFeed has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function parseCommandFeed($contents, $fields_that_can_contain_spaces = array())
                  {
                      // Line counter, -1 meaning reading headers
                      $line_counter = -1;
              
              
              Severity: Minor
              Found in pepiscms/application/models/Ssh_model.php - About 5 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 model has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function model($model, $name = '', $db_conn = false, $hardfail = true)
                  {
                      // Keep this redundancy
                      $original_model = $model;
                      $original_name = $name;
              Severity: Minor
              Found in pepiscms/application/core/PEPISCMS_Loader.php - About 5 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 makeTablesBeautiful has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  makeTablesBeautiful: function (handler) {
                      handler = $(handler);
                      $("td", handler).hover(
                          function (event) {
                              $(this).parent().children("td").addClass("hovered");
              Severity: Major
              Found in pepiscms/js/jquery.frontend.js - About 5 hrs to fix

                CrudFieldDefinitionBuilder has 40 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class CrudFieldDefinitionBuilder
                {
                    const LABEL_KEY = 'label';
                    const DESCRIPTION_KEY = 'description';
                    const INPUT_TYPE_KEY = 'input_type';
                Severity: Minor
                Found in pepiscms/application/classes/CrudFieldDefinitionBuilder.php - About 5 hrs to fix

                  Function edit has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function edit()
                      {
                          $group_id = $this->input->getParam('id');
                  
                          $add_new = !($group_id > 0);
                  Severity: Minor
                  Found in pepiscms/modules/cms_groups/controllers/Cms_groupsAdmin.php - About 5 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

                  File Spreadsheet.php has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * PepisCMS
                   *
                  Severity: Minor
                  Found in pepiscms/application/libraries/Spreadsheet.php - About 5 hrs to fix

                    Function mysqldump has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function mysqldump($db_host, $database, $db_user, $db_password, $tables = false, $dump_to_filename = false, $dump_structure = true)
                        {
                            if ($dump_to_filename && file_exists($dump_to_filename)) {
                                return false;
                            }
                    Severity: Minor
                    Found in pepiscms/application/helpers/mysqldump_helper.php - About 5 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 index has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function index($display_view = true)
                        {
                            $running_module = $this->getAttribute('running_module');
                            $definition = $this->getDefinition();
                    
                    
                    Severity: Minor
                    Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 5 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 index has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function index()
                        {
                            // Reading history
                            $query_history = $this->auth->getSessionVariable('sqlconsole_query_history');
                            if (!$query_history) {
                    Severity: Minor
                    Found in pepiscms/modules/sqlconsole/controllers/SqlconsoleAdmin.php - About 5 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 dologin has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function dologin()
                        {
                            $this->_oninit();
                            $this->load->library('Logger');
                    
                    
                    Severity: Minor
                    Found in pepiscms/application/controllers/admin/Login.php - About 4 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

                    Severity
                    Category
                    Status
                    Source
                    Language