piotrpolak/pepiscms

View on GitHub

Showing 481 of 486 total issues

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 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 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 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 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 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 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 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 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

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 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 renderComponent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function renderComponent($field, $value, $valueEscaped, &$object, $extra_css_classes)
    {
        $output_element = '';
        if (is_array($field['values'])) {
            $output_element .= '<select name="' . $field['field'] . '" id="' . $field['field'] . '" class="text' .

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 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 __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 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 regenerateSetAcceptedFieldsForExistingModel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function regenerateSetAcceptedFieldsForExistingModel($file_model_path, $data)
    {
        // Replace acceptable fields
        $model_file_contents_exploded = file($file_model_path, FILE_IGNORE_NEW_LINES);
        if (count($model_file_contents_exploded) > 0) {
Severity: Minor
Found in pepiscms/modules/development/libraries/ModuleGenerator.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 _write_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _write_cache($output)
    {
        // Failsafe variable
        $no_fastcacheable = true;

Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Output.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 _display_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _display_cache(&$CFG, &$URI)
    {
        // Failsafe variable
        $no_fastcacheable = true;

Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Output.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 edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit($display_view = true)
    {
        $id = $this->input->getParam('id');
        $sameuser = $this->auth->getUserId() == $id;

Severity: Minor
Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.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

Severity
Category
Status
Source
Language