imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function change_autoload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function change_autoload() {
        if ($this->input->post('mid')) {
            $mid = $this->input->post('mid');
            $row = $this->db->where('id', $mid)->get('components')->row();
            if (count($row) > 0) {
Severity: Minor
Found in application/modules/admin/components.php - About 45 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 removeInstanceFromPool has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function removeInstanceFromPool($value)
    {
        if (Propel::isInstancePoolingEnabled() && null !== $value) {
            if (is_object($value) && $value instanceof \xbanners\models\BannerImageI18n) {
                $key = serialize([(null === $value->getId() || is_scalar($value->getId()) || is_callable([$value->getId(), '__toString']) ? (string) $value->getId() : $value->getId()), (null === $value->getLocale() || is_scalar($value->getLocale()) || is_callable([$value->getLocale(), '__toString']) ? (string) $value->getLocale() : $value->getLocale())]);
Severity: Minor
Found in application/modules/xbanners/models/Map/BannerImageI18nTableMap.php - About 45 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 deleteNotExistingImages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteNotExistingImages() {
        $images = BannerImageI18nQuery::create()->setComment(__METHOD__)->find();

        $imagesSrc = [];
        foreach ($images as $image) {
Severity: Minor
Found in application/modules/xbanners/src/Managers/ImagesManager.php - About 45 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 doDelete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

     public static function doDelete($values, ConnectionInterface $con = null)
     {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
        }
Severity: Minor
Found in application/modules/xbanners/models/Map/BannerImageTableMap.php - About 45 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_categories has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_categories($order_by = 'name', $sort_order = 'desc') {
        if ($sort_order != 'desc' AND $sort_order != 'asc') {
            $sort_order = 'desc';
        }

Severity: Minor
Found in application/modules/gallery/models/gallery_m.php - About 45 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 getByPosition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.php - About 45 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 create_albums_covers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_albums_covers($albums = []) {
        $cnt = count($albums);
        for ($i = 0; $i < $cnt; $i++) {
            $thumb_url = '/' . $this->conf['upload_url'] . $albums[$i]['id'] . '/' . $this->conf['thumbs_folder'] . '/';

Severity: Minor
Found in application/modules/gallery/gallery.php - About 45 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 removeInstanceFromPool has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function removeInstanceFromPool($value)
    {
        if (Propel::isInstancePoolingEnabled() && null !== $value) {
            if (is_object($value) && $value instanceof \xbanners\models\BannersI18n) {
                $key = serialize([(null === $value->getId() || is_scalar($value->getId()) || is_callable([$value->getId(), '__toString']) ? (string) $value->getId() : $value->getId()), (null === $value->getLocale() || is_scalar($value->getLocale()) || is_callable([$value->getLocale(), '__toString']) ? (string) $value->getLocale() : $value->getLocale())]);
Severity: Minor
Found in application/modules/xbanners/models/Map/BannersI18nTableMap.php - About 45 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 toArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
    {

        if (isset($alreadyDumpedObjects['BannersI18n'][$this->hashCode()])) {
            return '*RECURSION*';
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersI18n.php - About 45 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 getByPosition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageI18n.php - About 45 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_albums has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_albums($order_by = 'date', $sort_order = 'desc', $category_id = 0) {
        // Select albums

        $locale = $this->chose_locale();
        $this->joinI18n($this->db, 'gallery_albums', $locale);
Severity: Minor
Found in application/modules/gallery/models/gallery_m.php - About 45 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 toArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
    {

        if (isset($alreadyDumpedObjects['BannerImageI18n'][$this->hashCode()])) {
            return '*RECURSION*';
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageI18n.php - About 45 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 update_album has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function update_album($id, $locale) {
        $this->form_validation->set_rules('name', lang('Name', 'gallery'), 'required');
        $tpl_file = $this->input->post('tpl_file');
        if (!preg_match('/[a-z]/', $tpl_file) && !empty($tpl_file)) {
            showMessage('wrong tpl name', '', 'r');
Severity: Minor
Found in application/modules/gallery/admin.php - About 45 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 _buildPageCategoryMeta has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function _buildPageCategoryMeta($model) {

        $local = MY_Controller::getCurrentLocale();

        CI::$APP->core->setLastModified($model['updated']);
Severity: Minor
Found in application/modules/mod_seo/mod_seo.php - About 45 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

Avoid deeply nested control flow statements.
Open

                        if (!defined('ENABLE_TRANSLATION_API')) {
                            define('ENABLE_TRANSLATION_API', TRUE);
                        }
Severity: Major
Found in application/modules/translator/translator.php - About 45 mins to fix

Function can_edit_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function can_edit_file($module_name, $entity_type) {

        if (!MAINSITE) {
            return TRUE;
        }
Severity: Minor
Found in application/modules/translator/helpers/translator_helper.php - About 45 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_mainsite_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function get_mainsite_url($url) {

        $true_path = preg_replace('/\/language(.*)/', '', $url);

        if (strstr($true_path, './templates/')) {
Severity: Minor
Found in application/modules/translator/helpers/translator_helper.php - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function __construct() {
        $this->ci = &get_instance();
        if (BaseDiscount::checkModuleInstall()) {
            include_once __DIR__ . '/../models/discount_model_front.php';
            $this->ci->discount_model_front = new discount_model_front;
Severity: Minor
Found in application/modules/mod_discount/classes/BaseDiscount.php - About 45 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 _buildPageMeta has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function _buildPageMeta($model) {

        CI::$APP->core->setLastModified($model['updated']);

        $local = MY_Controller::getCurrentLocale();
Severity: Minor
Found in application/modules/mod_seo/mod_seo.php - About 45 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 applyGift has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function applyGift() {

        $key = $this->input->post('gift');
        $aplyGift = false;
        foreach ($this->baseDiscount->discountType['certificate'] as $disc) {
Severity: Minor
Found in application/modules/mod_discount/mod_discount.php - About 45 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