piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

Function helpBubbles has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    helpBubbles: function (trigger, bubbleContentSrc, bubbleColor) {
        // declarations
        var hintColorClass;

        if (!bubbleContentSrc) {
Severity: Minor
Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

    Method render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render()
        {
            $this->benchmark->mark('widget_'.$this->module_name.'_'.$this->module_name.'_render_start');
            $controller_path = $this->modulepathresolver->getWidgetControllerPath($this->module_name);
    
    
    Severity: Minor
    Found in pepiscms/application/classes/WidgetRenderer.php - About 1 hr to fix

      Method display has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function display($view = false, $display_header = true, $display_footer = true, $return = false)
          {
              // Preventing from displaying the same page for several times
              if ($this->already_displayed) {
                  return false;
      Severity: Minor
      Found in pepiscms/application/classes/ModuleAdminController.php - About 1 hr to fix

        Method auth_driver has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function auth_driver()
            {
                $auth_drivers = array(
                    'native' => $this->lang->line('installer_auth_driver_native')
                );
        Severity: Minor
        Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

          Method generateFilePreview has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function generateFilePreview($field, $valueEscaped, $display_delete_file_link)
              {
                  \CI_Controller::get_instance()->load->helper('number');
                  $output_element = '';
                  if ($valueEscaped) {

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

                private function parsePolicy($path)
                {
                    if (!file_exists($path)) {
                        return false;
                    }
            Severity: Minor
            Found in pepiscms/application/libraries/SecurityPolicy.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 deleteFileIfUserFlagSelected has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function deleteFileIfUserFlagSelected(&$save_array, $upload_field_name)
                {
                    $wish_to_delete_file = $this->doesUserWishToDeleteFile($upload_field_name);
                    if ($wish_to_delete_file) {
                        $file_name_to_delete = $this->generateComputeFileField($upload_field_name);
            Severity: Minor
            Found in pepiscms/application/libraries/FormBuilder.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 ip_info has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                function ip_info($ip)
                {
                    if (!filter_var($ip, FILTER_VALIDATE_IP)) {
                        throw new InvalidArgumentException('IP is not valid');
                    }
            Severity: Minor
            Found in pepiscms/application/helpers/ip_helper.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 _fb_callback_make_filename_seo_friendly has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
                {
                    $data['name'] = 'customization';
            
                    // List of the fields to be used, if no value is present for a given key
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Setup.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 genericupload has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function genericupload($current_path = '', $file_field_name = 'file')
                {
                    $make_filenames_nice = true;
            
                    $error = false;
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Ajaxfilemanager.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 getDashboardElements has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getDashboardElements()
                {
                    $module_names = $this->modulerunner->getInstalledModulesNamesCached();
                    $dashboard_elements = array();
                    foreach ($module_names as $module_name) {
            Severity: Minor
            Found in pepiscms/application/classes/AbstractDashboardController.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 generateForeignKeyFetchObjectValues has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function generateForeignKeyFetchObjectValues($field)
                {
                    // Resolving FOREIGN_KEY_MANY_TO_MANY relationship for a valid definition
                    if ($field['foreign_key_relationship_type'] == FormBuilder::FOREIGN_KEY_MANY_TO_MANY
                        && $field['foreign_key_junction_table']
            Severity: Minor
            Found in pepiscms/application/libraries/FormBuilder.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 getDashboardElementsGrouped has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getDashboardElementsGrouped($dashboard_elements, $default_dashboard_element_group)
                {
                    $dashboard_elements_grouped = array();
                    foreach ($dashboard_elements as $dashboard_element) {
                        if ($this->auth->isUserRoot() || !isset($dashboard_element['controller'])
            Severity: Minor
            Found in pepiscms/application/classes/AbstractDashboardController.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 generateCall has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function generateCall($value, $datagrid_constants, $formbuilder_constants, $tabs)
                {
                    $definition_output = '';
                    foreach ($value as $v_key => $v_value) {
                        if ($v_key == 'filter_type') {
            Severity: Minor
            Found in pepiscms/modules/development/libraries/ModuleGenerator.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 getTableLabelFieldName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getTableLabelFieldName($table, $exclude_field_names = array())
                {
                    // Try from set of possible labels
                    $allowed_labels = array('name', 'label', 'username', 'login', 'fitst_name', 'last_name', 'code', 'id');
                    $fk_table_definition = $this->getDefinitionFromTable($table, false);
            Severity: Minor
            Found in pepiscms/modules/crud/libraries/TableUtility.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 menurendor_render_submenu has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function menurendor_render_submenu($menu_items, $level = 1)
                {
                    $prefix = "\t";
                    for ($i = 0; $i < $level; $i++) {
                        $prefix .= "\t";
            Severity: Minor
            Found in pepiscms/application/views/templates/menurendor_menu.php - About 1 hr to fix

              Method index has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function index()
                  {
                      $enable_frontend = $this->config->item('cms_enable_frontend');
                      $intranet = $this->config->item('cms_intranet');
              
              
              Severity: Minor
              Found in pepiscms/application/controllers/public/Sitemap.php - About 1 hr to fix

                Method display has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function display($view = false, $display_header = true, $display_footer = true, $return = false)
                    {
                        $this->benchmark->mark('display_start');
                
                        if ($this->already_displayed) {
                Severity: Minor
                Found in pepiscms/application/classes/ModuleController.php - About 1 hr to fix

                  Method logs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function logs($collection, $resource_id = null, $title = false)
                      {
                          $where_conditions = array('collection' => $collection);
                  
                          if ($resource_id) {
                  Severity: Minor
                  Found in pepiscms/modules/logs/controllers/LogsWidget.php - About 1 hr to fix

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

                        public function saveConfigByName($name, $value, $module = null)
                        {
                            $entry = $this->getByName($name);
                    
                            $id = false;
                    Severity: Minor
                    Found in pepiscms/application/models/Siteconfig_model.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language