imagecms/ImageCMS

View on GitHub

Showing 1,858 of 1,858 total issues

File ParentWishlist.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace wishlist\classes;

use CI_DB_active_record;
Severity: Minor
Found in application/modules/wishlist/classes/ParentWishlist.php - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function setno() {
        $comid = $this->input->post('comid');
        if ($this->session->userdata('commentl' . $comid) != 1) {
            $row = $this->db->where('id', $comid)->get('comments')->row();
            $disslike = $row->disslike;
Severity: Major
Found in application/modules/comments/commentsapi.php and 1 other location - About 5 hrs to fix
application/modules/comments/commentsapi.php on lines 600..617

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 200.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function setyes() {
        $comid = $this->input->post('comid');
        if ($this->session->userdata('commentl' . $comid) != 1) {
            $row = $this->db->where('id', $comid)->get('comments')->row();
            $like = $row->like;
Severity: Major
Found in application/modules/comments/commentsapi.php and 1 other location - About 5 hrs to fix
application/modules/comments/commentsapi.php on lines 619..636

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 200.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function buildOptions has 145 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildOptions($cont, $slides, els, options, o) {
    // support metadata plugin (v1.0 and v2.0)
    var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
    if (opts.autostop)
        opts.countdown = opts.autostopCount || els.length;
Severity: Major
Found in application/modules/xbanners/assets/js/cycle.js - About 5 hrs to fix

Function create has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        create: function(opt, root) {
            if (root === undefined) {
                root = opt;
            }
            // create contextMenu

File admin.php has 402 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

(defined('BASEPATH')) OR exit('No direct script access allowed');

use CMSFactory\assetManager;
Severity: Minor
Found in application/modules/callbacks/admin.php - About 5 hrs to fix

Method command_sale_query has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function command_sale_query() {

        $xml_order = '';

        if ($this->check_perm() === true) {
Severity: Major
Found in application/modules/exchange/exchange.php - About 5 hrs to fix

Function newPost has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function newPost() {
        $this->load->model('base');
        $this->_init_settings();

        ($hook = get_hook('comments_on_add')) ? eval($hook) : NULL;
Severity: Minor
Found in application/modules/comments/commentsapi.php - About 5 hrs 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 getBannersI18ns has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannersI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannersI18nsPartial && !$this->isNew();
        if (null === $this->collBannersI18ns || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannersI18ns) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.php - About 5 hrs 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 getBannerImages has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannerImages(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannerImagesPartial && !$this->isNew();
        if (null === $this->collBannerImages || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannerImages) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.php - About 5 hrs 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 getBannerImageI18ns has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannerImageI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannerImageI18nsPartial && !$this->isNew();
        if (null === $this->collBannerImageI18ns || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannerImageI18ns) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.php - About 5 hrs 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 getSCategories has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSCategories(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collSCategoriesPartial && !$this->isNew();
        if (null === $this->collSCategories || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collSCategories) {
Severity: Minor
Found in application/modules/core/models/Base/Route.php - About 5 hrs 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 getSProductss has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSProductss(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collSProductssPartial && !$this->isNew();
        if (null === $this->collSProductss || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collSProductss) {
Severity: Minor
Found in application/modules/core/models/Base/Route.php - About 5 hrs 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 DB has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

function &DB($params = '', $active_record_override = NULL) {
    // Load the DB config file if a DSN string wasn't passed
    if (is_string($params) AND strpos($params, '://') === FALSE) {
        
        // the only logic changes are in next few lines        
Severity: Minor
Found in application/core/database/DB.php - About 5 hrs 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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ($includeForeignObjects) {
            if (null !== $this->collSCategories) {

                switch ($keyType) {
                    case TableMap::TYPE_CAMELNAME:
Severity: Major
Found in application/modules/core/models/Base/Route.php and 1 other location - About 5 hrs to fix
application/modules/xbanners/models/Base/Banners.php on lines 1033..1064

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 193.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ($includeForeignObjects) {
            if (null !== $this->collBannerImages) {

                switch ($keyType) {
                    case TableMap::TYPE_CAMELNAME:
Severity: Major
Found in application/modules/xbanners/models/Base/Banners.php and 1 other location - About 5 hrs to fix
application/modules/core/models/Base/Route.php on lines 989..1020

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 193.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    $('.dropdown-attr a').unbind('click').bind('click', function () {
        $startPoint = $(this).closest('div');
        $name = $(this).text();
        $attname = $(this).attr('data-attname');
        $names = '';
Severity: Major
Found in application/modules/import_export/assets/js/importAdmin.js and 1 other location - About 5 hrs to fix
application/modules/import_export/assets/js/importExportAdmin.js on lines 85..97

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if ($this.closest('thead')[0] != undefined) {
            changeCheck($this.find('.niceCheck'));
            if ($this.hasClass('active')) {
                $this.parents('table').find('.frame_label').each(function () {
                    changeCheckallchecks($(this).find('.niceCheck'));
Severity: Major
Found in application/modules/xbanners/assets/js/script.js and 1 other location - About 5 hrs to fix
application/modules/xbanners/assets/js/script.js on lines 59..74

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    $('.dropdown-attr a').unbind('click').bind('click', function () {
        $startPoint = $(this).closest('div');
        $name = $(this).text();
        $attname = $(this).attr('data-attname');
        $names = '';
application/modules/import_export/assets/js/importAdmin.js on lines 78..90

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        else if ($this.closest('.head')[0] != undefined) {
            changeCheck($this.find('.niceCheck'));
            if ($this.hasClass('active')) {
                $this.parents('#category').find('.frame_label').each(function () {
                    changeCheckallchecks($(this).find('.niceCheck'));
Severity: Major
Found in application/modules/xbanners/assets/js/script.js and 1 other location - About 5 hrs to fix
application/modules/xbanners/assets/js/script.js on lines 46..74

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language