imagecms/ImageCMS

View on GitHub

Showing 1,858 of 1,858 total issues

Function create_menu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_menu() {

        //cp_check_perm('menu_create');
        if ($this->input->post('menu_name') == NULL) {
            showMessage(lang('Name field sieve', 'menu'), '', 'r');
Severity: Minor
Found in application/modules/menu/admin.php - About 25 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_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_item() {

        $item_id = (int) $this->input->post('item_id');

        $this->db->where('id', $item_id);
Severity: Minor
Found in application/modules/menu/admin.php - About 25 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 processCategories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function processCategories(\SimpleXMLElement $categories, $parent = NULL) {
        foreach ($categories as $category) {
            $externalId = (string) $category->Ид;

            // splitting on those which need to be updated and new (by external id)
Severity: Minor
Found in application/modules/exchange/classes/Categories.php - About 25 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 getBrandIdByName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBrandIdByName($brandName) {

        if (!is_string($brandName) || !isset($brandName[0])) {
            return null;
        }
Severity: Minor
Found in application/modules/exchange/classes/Properties.php - About 25 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 checkPaid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkPaid($param) {
        $ci = &get_instance();

        $order_id = $param['ik_pm_no'];
        $userOrder = $ci->db->where('id', $order_id)

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

    public function auto_complit($type) {

        $s_limit = $this->input->get('limit');
        $s_coef = $this->input->get('term');

Severity: Minor
Found in application/modules/user_manager/admin.php - About 25 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 findPk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function findPk($key, ConnectionInterface $con = null)
    {
        if ($key === null) {
            return null;
        }
Severity: Minor
Found in application/modules/core/models/Base/RouteQuery.php - About 25 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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function index($id) {

        $page = $this->model->getPage($id);

        if (!$page) {
Severity: Minor
Found in application/modules/core/src/Controller/PageController.php - About 25 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 getFullUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFullUrl($locale = true, $filterSegments = true, $getParams = true) {

        if ($filterSegments) {
            $url = $this->segments;
        } else {
Severity: Minor
Found in application/modules/core/src/UrlParser.php - About 25 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 setByPosition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
Severity: Minor
Found in application/modules/core/models/Base/Route.php - About 25 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 addCharacteristic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addCharacteristic($name, $value) {

        if (!is_string($name) || !is_string($value)) {
            // not a string
            return;
Severity: Minor
Found in application/modules/exchange/classes/VariantCharacteristics.php - About 25 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 getVariantCharacteristics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getVariantCharacteristics($variantName) {

        /*
         * Примітка до визначення характеристик варіанту - може бути накладка
         * із визначенням характеристик що складаються більше ніж із одного
Severity: Minor
Found in application/modules/exchange/classes/VariantCharacteristics.php - About 25 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 main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function main() {

        if ($this->ci->input->get() || strstr($this->ci->input->server('REQUEST_URI'), '?')) {
            $this->ci->template->registerCanonical(site_url());
        }
Severity: Minor
Found in application/modules/core/src/FrontController.php - About 25 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 getDefaultLanguage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultLanguage() {

        if ($this->defaultLanguage === null) {
            foreach ($this->getLanguages() as $language) {
                if ($language['default'] == 1) {
Severity: Minor
Found in application/modules/core/src/CoreModel.php - About 25 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 _highlight_text has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _highlight_text($data, $text) {
        if (!$data) {
            return;
        }
        $dataCount = count($data);
Severity: Minor
Found in application/modules/search/search.php - About 25 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 array_to_uri has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function array_to_uri($arr = []) {
        $n = 0;
        $str = '?';
        $cnt = count($arr);
Severity: Minor
Found in application/core/MY_URI.php - About 25 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 getCurrentLanguage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCurrentLanguage($field = null) {

        if (!self::$currentLanguage) {
            $ci = get_instance();
            if (preg_match('/^\/install/', $ci->input->server('PATH_INFO'))) {
Severity: Minor
Found in application/core/MY_Controller.php - About 25 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 _init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function _init() {

        if (!strstr(CI::$APP->input->server('REQUEST_URI'), 'install')) {
            if (null == CI::$APP->db) {
                $error = &load_class('Exceptions', 'core');
Severity: Minor
Found in application/core/MY_Lang.php - About 25 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