imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

    public function moveItem($varId, $wish_list_id, $to_listId = '', $to_listName = '', $user_id = null) {
Severity: Minor
Found in application/modules/wishlist/classes/ParentWishlist.php - About 35 mins to fix

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

    protected function drawTextB($text, $x, $y, $width, $height) {

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

    public function updateVariable($template_id, $variable, $variableNewValue, $oldVariable, $locale) {
Severity: Minor
Found in application/modules/cmsemail/models/cmsemail_model.php - About 35 mins to fix

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

    public function updateVariable($template_id, $variable, $variableNewValue, $oldVariable, $locale) {
Severity: Minor
Found in application/modules/cmsemail/classes/ParentEmail.php - About 35 mins to fix

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

    public function add_to_ZIP($files = []) {

        if (empty($files)) {
            throw new Exception(lang('Nothing to create', 'admin'));
        }
Severity: Minor
Found in application/libraries/Update.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 replaceDynamically has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function replaceDynamically($sString) {
        $aTrad = [];
        for ($i = 1, $iMax = func_num_args(); $i < $iMax; $i++) {
            $arg = func_get_arg($i);
            if (is_array($arg)) {
Severity: Minor
Found in application/libraries/MY_Lang.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 captcha_check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function captcha_check($code) {
        $CI = get_instance();
        $result = TRUE;

        if ($this->use_recaptcha) {
Severity: Minor
Found in application/libraries/DX_Auth.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 count_words has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function count_words() {

        $tmp_arr = [];
        foreach ($this->origin_arr as $val) {
            if (strlen(utf8_decode($val)) >= $this->min_word_length) {
Severity: Minor
Found in application/libraries/lib_seo.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 get_translated_array has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_translated_array() {
        $translated = [];
        $lang = $this->defaultLocaleId;

        $ck = 'categories_translated_array_' . $lang;
Severity: Minor
Found in application/libraries/lib_category.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 get_errors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function get_errors($prefix = '', $suffix = '') {

        if (validation_errors()) {
            return validation_errors($prefix = '', $suffix = '');
        }
Severity: Minor
Found in application/helpers/template_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 media_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function media_url($url = '') {

        $CI = &get_instance();
        /* @var $config CI_Config */
        $config = $CI->config;
Severity: Minor
Found in application/helpers/my_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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($locale = NULL) {
        if ($this->useLocales === TRUE) {
            $this->locale = $locale !== null ? $locale : MY_Controller::getCurrentLocale();
        }

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

    function chose_language($active = FALSE) {
        $ci = &get_instance();

        $url_arr = $ci->uri->segment_array();
        foreach ((array) MY_Controller::getAllLocales($active) as $l) {
Severity: Minor
Found in application/helpers/language_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 check_perm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function check_perm($perm) {
        $ci = & get_instance();

        if ($ci->dx_auth->is_logged_in()) {
            if ($ci->dx_auth->get_permission_value($perm)) {
Severity: Minor
Found in application/helpers/rules_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 get_main_lang has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function get_main_lang($flag = null) {
    $ci = &get_instance();
    if (!$ci->db) {
        return FALSE;
    }
Severity: Minor
Found in application/helpers/language_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 tpl_register_asset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function tpl_register_asset($path, $position = 'before') {

        if (is_array($path)) {

            foreach ($path as $value) {
Severity: Minor
Found in application/helpers/template_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 convertXLStoCSV has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function convertXLStoCSV($excel_file = '') {
        $objReader = PHPExcel_IOFactory::createReaderForFile($excel_file);
        $objReader->setReadDataOnly(true);
        $objPHPExcel = $objReader->load($excel_file);
        $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
Severity: Minor
Found in application/modules/import_export/import.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 saveCSVFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function saveCSVFile() {
        $this->takeFileName();

        $this->load->library(
            'upload',
Severity: Minor
Found in application/modules/import_export/import.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 outputChart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function outputChart(array $lines) {
        $result = $this->controller->orders_model->getOrdersInfo(
            [
             'dateFrom' => isset($_GET['from']) ? $_GET['from'] : '2005-05-05',
             'dateTo'   => isset($_GET['to']) ? $_GET['to'] : date('Y-m-d'),
Severity: Minor
Found in application/modules/mod_stats/controllers/OrdersController.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 getFullField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getFullField($fieldName) {
        if (preg_match('/^\`[0-9a-zA-Z\_]+\`\.\`[0-9a-zA-Z\_]+\`/i', $fieldName)) {
            return $fieldName;
        } elseif (preg_match('/^[0-9a-zA-Z\_]+$/i', $fieldName)) {
            // тільки поле
Severity: Minor
Found in application/modules/import_export/classes/Export.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