piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

Method formatCells has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function formatCells($menu, $level, &$lang, &$url_suffix, $site_language)
Severity: Minor
Found in pepiscms/modules/pages/views/admin/index_simple.php - About 35 mins to fix

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

        public function getBreadcrumbMenuItems()
        {
            $breadcrumb_items = array();
            $item = $this->getMenu()->getMenuItemByCanonicalAbsoluteUrl($this->getCanonicalAbsoluteUrl());
    
    
    Severity: Minor
    Found in pepiscms/application/libraries/Document.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 log_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    function log_message($level = 'error', $message, $php_error = false)
    {
        if (!class_exists('Logger')) {
            return;
        }
    Severity: Minor
    Found in pepiscms/application/hooks/BootstapHook.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 getAvailableModules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getAvailableModules()
        {
            $modules_dir = INSTALLATIONPATH . 'modules/';
            $modules = scandir($modules_dir);
            $modules_out = array();
    Severity: Minor
    Found in pepiscms/application/libraries/ModuleRunner.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 journalingGetById has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function journalingGetById($id, $revision_id = false)
        {
            $row = $this->getById($id);
            if ($revision_id && $this->getJournalingIsEnabled()) {
                $row_archived = $this->db->select('data_serialized')
    Severity: Minor
    Found in pepiscms/application/models/Generic_model.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 getAssocPairs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getAssocPairs($key_column_name, $value_column_name, $table = false, $imitial_array = false,
                                      $possible_keys = false, $where_conditions = false)
        {
            if (!$table) {
                $table = $this->getTable();
    Severity: Minor
    Found in pepiscms/application/models/Generic_model.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 applyOffset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function applyOffset($output, $offset, $rowCount)
        {
            $filtered_output = array();
    
            $current_index = -1;
    Severity: Minor
    Found in pepiscms/application/models/Array_model.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 _saveByIdFilterData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _saveByIdFilterData($data, $accepted_post_fields)
        {
            // Reading fields that should be nullified when empty
            $nullify_on_empty_post_fields = $this->getNullifyOnEmptyPostFields();
    
    
    Severity: Minor
    Found in pepiscms/application/models/Generic_model.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 generateForeignKeyFillFieldPossibleValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function generateForeignKeyFillFieldPossibleValues(&$field)
        {
            $should_fetch = false;
            if (!$field['input_is_editable']) {
                // is_array is required for multiple checkbox fields, etc - avoiding errors
    Severity: Minor
    Found in pepiscms/application/libraries/FormBuilder.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 generateRecreateObjectFromSaveArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function generateRecreateObjectFromSaveArray($save_array)
        {
            // If there were no object, lets generate it from a dummy class to prevent useless errors
            if (!$this->object) {
                $this->object = new stdClass();
    Severity: Minor
    Found in pepiscms/application/libraries/FormBuilder.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 current_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        function current_url()
        {
            $pageURL = 'http';
            if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
                $pageURL .= 's';
    Severity: Minor
    Found in pepiscms/application/helpers/PEPISCMS_url_helper.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 doIntranetCheck has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function doIntranetCheck($uri)
        {
            $intranet = $this->config->item('cms_intranet');
            if ($intranet) {
                $this->load->library('Auth');
    Severity: Minor
    Found in pepiscms/application/controllers/public/Displaypage.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            parent::__construct(false);
            $this->benchmark->mark('module_admin_controller_start');
    
    
    Severity: Minor
    Found in pepiscms/application/classes/ModuleAdminController.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 getFormButtons has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFormButtons()
        {
            $output = '<div class="buttons">' . "\n";
            if ($this->formbuilder->getBackLink()) {
                $output .= button_cancel($this->formbuilder->getBackLink());
    Severity: Minor
    Found in pepiscms/application/classes/DefaultFormRenderer.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 searchForChildByCanonicalAbsoluteUrl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function searchForChildByCanonicalAbsoluteUrl($children, $url)
        {
            if (!is_array($children) || !(count($children) > 0)) {
                return false;
            }
    Severity: Minor
    Found in pepiscms/application/classes/Menu.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 drawSimpleColumnChart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
        {
            $id = $this->generateId('column_chart');
    
            $out = $this->includeJavaScripts();
    Severity: Minor
    Found in pepiscms/application/libraries/Google_chart_helper.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 module_resources_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        function module_resources_url($module_name = false)
        {
            $CI = get_instance();
            if (!$module_name) {
                if (isset($CI->modulerunner)) {
    Severity: Minor
    Found in pepiscms/application/helpers/PEPISCMS_url_helper.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 generateHandleForeignKeyManyToManyUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function generateHandleForeignKeyManyToManyUpdate(&$save_array)
        {
            foreach ($this->fields as $field) {
                // As we are already looping, lets do some magic
                if ($field['foreign_key_table']
    Severity: Minor
    Found in pepiscms/application/libraries/FormBuilder.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 getDashboardWidgetMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getDashboardWidgetMap()
        {
            $this->benchmark->mark('computing_dashboard_widget_map_start');
            $module_names = $this->modulerunner->getInstalledModulesNamesCached();
    
    
    Severity: Minor
    Found in pepiscms/application/controllers/admin/About.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function execute($baseDir, $currentRelativePath, $input)
        {
            $files = $this->getFiles($input);
    
            $new_name = $this->cleanupFileName($files[1]);

    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