imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function create() {

        if ($this->input->post()) {
            $postArray = $this->input->post();

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

    public function getDiscountBy($key, $id) {

        $this->baseDiscount = BaseDiscount::create();
        foreach ($this->baseDiscount->allDiscount as $disc) {
            switch ($key) {
Severity: Minor
Found in application/modules/mod_discount/discount_api.php - About 55 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 _buildBrandMeta has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function _buildBrandMeta($arg) {

        $local = MY_Controller::getCurrentLocale();
        /* @var $model SBrands */
        $model = $arg['model'];
Severity: Minor
Found in application/modules/mod_seo/mod_seo.php - About 55 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 copyLangs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function copyLangs() {

        $it = new RecursiveDirectoryIterator('/var/www/_image.loc/');

        foreach (new RecursiveIteratorIterator($it) as $file) {
Severity: Minor
Found in application/modules/translator/translator.php - About 55 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function create($name, $type, $lang, $settings) {
        if ($name && $type && $lang) {
            $url = $this->getPoFileUrl($name, $type, $lang);

            if (file_exists($url)) {
Severity: Minor
Found in application/modules/translator/classes/PoFileManager.php - About 55 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 saveSiteMap has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveSiteMap() {
        $lang = new MY_Lang();
        $lang->load('sitemap');
        $successMessage = lang('Site map have been saved', 'sitemap');
        $successMessageTitle = lang('Site map have been saved', 'sitemap');
Severity: Minor
Found in application/modules/sitemap/admin.php - About 55 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 loadComponentsXML has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadComponentsXML() {

        if (!isset($this->xmlData['xml']->components)) {
            return;
        }
Severity: Minor
Found in application/modules/template_manager/classes/Template.php - About 55 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 verifyQuery has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyQuery($query) {
        if (!$query) {
            return false;
        }

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

    public function verify($installDemodata = FALSE) {
        foreach ($this->dependicies as $key => $node) {
            $attributes = $node->attributes();
            $handlerClass = 'template_manager\\installer\\' . ucfirst($attributes['entityName']) . 'Dependence';
            include_once __DIR__ . DIRECTORY_SEPARATOR . $handlerClass . EXT;
Severity: Minor
Found in application/modules/template_manager/installer/DependenceDirector.php - About 55 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 loadScreenshotsXML has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadScreenshotsXML() {
        if (!isset($this->xmlData['xml']->screenshots)) {
            return;
        }

Severity: Minor
Found in application/modules/template_manager/classes/Template.php - About 55 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 getParam has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParam($key = NULL, $force = FALSE) {
        if (!isset(self::$componentsData[$this->name]) || $force != FALSE) {
            self::$componentsData[$this->name] = [];

            $result = \CI::$APP->db
Severity: Minor
Found in application/modules/template_manager/classes/TComponent.php - About 55 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 updateWL has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateWL() {
        $id = $this->input->post('WLID');
        $wlDescription = $this->input->post('description');

        if (iconv_strlen($wlDescription, 'UTF-8') > $this->settings['maxWLDescLenght']) {
Severity: Minor
Found in application/modules/wishlist/classes/BaseApi.php - About 55 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 updateWL has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateWL() {

        $id = $this->input->post('WLID');
        $wlDescription = $this->input->post('description');

Severity: Minor
Found in application/modules/wishlist/classes/BaseWishlist.php - About 55 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 setListener has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function setListener($callback, $alias = null) {

        if ($alias !== null && $this->key !== null) {
            throw new Exception("Can't declarete both.");
        }
Severity: Minor
Found in application/modules/CMSFactory/BaseEvents.php - About 55 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 userUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function userUpdate() {

        if ($this->settings['maxDescLenght'] < iconv_strlen($this->input->post('description'), 'UTF-8')) {
            $desc = mb_substr($this->input->post('description'), 0, $this->settings['maxDescLenght'], 'UTF-8');
        } else {
Severity: Minor
Found in application/modules/wishlist/classes/BaseWishlist.php - About 55 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 do_upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function do_upload() {
        if ($this->input->post('userID')) {
            if (parent::do_upload($this->input->post('userID'))) {
                if (!$this->upload->do_upload()) {
                    $this->errors[] = $this->upload->display_errors();
Severity: Minor
Found in application/modules/wishlist/classes/BaseApi.php - About 55 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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function run($callback) {
        if ($callback) {

            $data = [];
            if (self::isSaas() && !\Admin_menu::$DEV_MODE) {
Severity: Minor
Found in application/modules/admin_menu/classes/MenuCallback.php - About 55 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 userUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function userUpdate() {

        if ($this->settings['maxDescLenght'] < iconv_strlen($this->input->post('description'), 'UTF-8')) {
            $desc = mb_substr($this->input->post('description'), 0, $this->settings['maxDescLenght'], 'UTF-8');
        } else {
Severity: Minor
Found in application/modules/wishlist/classes/BaseApi.php - About 55 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 deleteAllWL has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteAllWL($UserID) {
        $forReturn = TRUE;

        $WLs = $this->wishlist_model->getAllUserWLs($UserID);
        if ($forReturn) {
Severity: Minor
Found in application/modules/wishlist/classes/ParentWishlist.php - About 55 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function render() {

        $return = [];
        /** @var string $w wrapper */
        $w = $this->getWrapper();
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 55 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