imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

    public function grab_variables($n) {

        $args = [];

        foreach ($this->uri->uri_to_assoc($n) as $k => $v) {
Severity: Minor
Found in application/modules/core/core.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(RouteTableMap::DATABASE_NAME);
        }
Severity: Minor
Found in application/modules/core/models/Map/RouteTableMap.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 getCurrentLocale has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCurrentLocale() {

        $ci = get_instance();
        $lang_id = $ci->config->item('cur_lang');
        if (self::$currentLocale && $lang_id == self::$currentLangId) {
Severity: Minor
Found in application/core/MY_Controller.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 _display has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _display($pages = [], $foundInCategories = null) {
        /*         * Prepare categories for search results * */
        $categoriesInSearchResults = null;
        $tree = null;
        $categories = [];
Severity: Minor
Found in application/modules/search/search.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

Consider simplifying this complex logical expression.
Open

    if (manual || !p.cyclePause) {
        var fx = opts.fx;
        // keep trying to get the slide size if we don't have it yet
        curr.cycleH = curr.cycleH || $(curr).height();
        curr.cycleW = curr.cycleW || $(curr).width();
Severity: Major
Found in application/modules/xbanners/assets/js/cycle.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                    } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
                        e.preventDefault();
                        $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
                    }
Severity: Major
Found in application/modules/gallery/assets/js/jquery.fancybox-1.3.4.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                    if (opt.$layer && !opt.hovering && (!(e.pageX >= pos.left && e.pageX <= pos.right) || !(e.pageY >= pos.top && e.pageY <= pos.bottom))) {
                        // if mouse in menu...
                        opt.$menu.trigger('contextmenu:hide');
                    }

Consider simplifying this complex logical expression.
Open

        <?php if (isset($sections['http_headers']) || isset($sections['get']) || isset($sections['config']) || isset($sections['post']) || isset($sections['uri_string']) || isset($sections['controller_info'])) : ?>
            <a href="#" id="ci-profiler-menu-vars" onclick="ci_profiler_bar.show('ci-profiler-vars', 'ci-profiler-menu-vars'); return false;">
                <span>vars</span> &amp; Config
            </a>
        <?php endif; ?>
Severity: Major
Found in application/views/profiler_template.php - About 40 mins to fix

Function createPagerAnchor has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
Severity: Minor
Found in application/modules/xbanners/assets/js/cycle.js - About 35 mins to fix

Function tooltip has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

                    var tooltip = function (key, x, y, e, graph) {
Severity: Minor
Found in application/modules/mod_stats/assets/js/scripts.js - About 35 mins to fix

Function custom has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

$.fn.cycle.custom = function(curr, next, opts, cb, speedOverride) {
Severity: Minor
Found in application/modules/xbanners/assets/js/cycle.js - About 35 mins to fix

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

    public function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') {
Severity: Minor
Found in application/libraries/MY_Lang.php - About 35 mins to fix

Function fxFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    opts.fxFn = function(curr, next, opts, cb, fwd) {
Severity: Minor
Found in application/modules/xbanners/assets/js/cycle.js - About 35 mins to fix

Function buildOptions has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function buildOptions($cont, $slides, els, options, o) {
Severity: Minor
Found in application/modules/xbanners/assets/js/cycle.js - About 35 mins to fix

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

    function emmet_money($price, $priceWrapper = null, $coinsWrapper = null, $symbolWrapper = null, $currency = null) {
Severity: Minor
Found in application/helpers/template_helper.php - About 35 mins to fix

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

function showMessage($message, $title = FALSE, $class = '', $ret = false, $timeout = false) {
Severity: Minor
Found in application/helpers/javascript_helper.php - About 35 mins to fix

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

function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = []) {
Severity: Minor
Found in application/helpers/recaptcha_helper.php - About 35 mins to fix

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

    public function get($item_id, $status = 0, $module, $limit = 999999, $order_by) {
Severity: Minor
Found in application/modules/comments/models/base.php - About 35 mins to fix

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

    public function get_album($id = 0, $include_images = TRUE, $limit, $page, $locale = null) {
Severity: Minor
Found in application/modules/gallery/models/gallery_m.php - About 35 mins to fix

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

    private function searchLang($origin, $data, $entity_type, $entity_name, $language) {
Severity: Minor
Found in application/modules/translator/classes/PoFileSearch.php - About 35 mins to fix
Severity
Category
Status
Source
Language