imagecms/ImageCMS

View on GitHub

Showing 1,858 of 1,858 total issues

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

    public function edit_banner($id, $locale = NULL) {
        $locale = $locale ?: MY_Controller::defaultLocale();

        $banner = BannersQuery::create()
            ->findPk($id);
Severity: Minor
Found in application/modules/xbanners/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 clearAllReferences has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function clearAllReferences($deep = false)
    {
        if ($deep) {
            if ($this->collBannerImageI18ns) {
                foreach ($this->collBannerImageI18ns as $o) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.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 update_info has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function update_info($id, $locale = null) {

        if (null === $locale) {
            $locale = $this->gallery_m->chose_locale();
        }
Severity: Minor
Found in application/modules/gallery/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 buildCriteria has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildCriteria()
    {
        $criteria = new Criteria(BannersTableMap::DATABASE_NAME);

        if ($this->isColumnModified(BannersTableMap::COL_ID)) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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/xbanners/models/Base/BannersQuery.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 create_album has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_album() {
        $this->load->library('Form_validation');

        $this->form_validation->set_rules('name', lang('Name', 'gallery'), 'required|min_length[3]|max_length[250]');
        $this->form_validation->set_rules('email', lang('Description', 'gallery'), 'max_length[500]');
Severity: Minor
Found in application/modules/gallery/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 delete_category has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete_category() {
        foreach ($this->input->post('id') as $id) {

            // Delete category albums
            $albums = $this->gallery_m->get_albums('date', 'desc', $id);
Severity: Minor
Found in application/modules/gallery/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 removeTranslation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeTranslation($locale = 'ru', ConnectionInterface $con = null)
    {
        if (!$this->isNew()) {
            ChildBannerImageI18nQuery::create()
                ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.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 removeTranslation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeTranslation($locale = 'ru', ConnectionInterface $con = null)
    {
        if (!$this->isNew()) {
            ChildBannersI18nQuery::create()
                ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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 fromArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
    {
        $keys = BannerImageI18nTableMap::getFieldNames($keyType);

        if (array_key_exists($keys[0], $arr)) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageI18n.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/xbanners/models/Base/BannerImageQuery.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 addBannersI18n has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addBannersI18n(ChildBannersI18n $l)
    {
        if ($l && $locale = $l->getLocale()) {
            $this->setLocale($locale);
            $this->currentTranslations[$locale] = $l;
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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 getGiftCertificate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getGiftCertificate($key = null, $totalPrice = null) {
        $cart = BaseCart::getInstance();
        $this->baseDiscount = BaseDiscount::create();
        if ($totalPrice === null) {
            $totalPrice = $cart->getTotalPrice();
Severity: Minor
Found in application/modules/mod_discount/discount_api.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 updateOne has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateOne() {

        $name = $this->input->post('name');
        $type = $this->input->post('type');
        $locale = $this->input->post('locale');
Severity: Minor
Found in application/modules/translator/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 getAllOrderDiscountRegister has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getAllOrderDiscountRegister() {

        $allOrderArrReg = [];
        foreach ($this->discountType['all_order'] as $disc) {
            if (!$disc['is_gift']) {
Severity: Minor
Found in application/modules/mod_discount/classes/BaseDiscount.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 ajaxChangeActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function ajaxChangeActive() {
        $id = $this->input->post('id');

        // checking if discount exists
        $res = CI::$APP->db->get_where('mod_shop_discounts', ['id' => $id])->row_array();
Severity: Minor
Found in application/modules/mod_discount/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 getAllOrderDiscountNotRegister has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getAllOrderDiscountNotRegister() {
        $allOrderArrNotReg = [];
        foreach ($this->discountType['all_order'] as $disc) {
            if (!$disc['is_gift']) {
                if ($disc['begin_value'] <= $this->total_Price and ! $disc['for_autorized']) {
Severity: Minor
Found in application/modules/mod_discount/classes/BaseDiscount.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 setInitial has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setInitial($data = []) {

        if (count($data)) {
            foreach ($data as $key => $val) {
                if (isset($this->$key) AND method_exists($this->$key, 'setInitial')) {
Severity: Minor
Found in application/modules/forms/forms.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 _numberAdd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _numberAdd($arg) {
        $ci = &get_instance();
        $prodId = $arg['productId'];

        $prodVar = $ci->db
Severity: Minor
Found in application/modules/mod_auto_number/mod_auto_number.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 parseMain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseMain() {

        try {
            if (!is_dir(self::$MAIN_PATH)) {
                return [];
Severity: Minor
Found in application/modules/translator/classes/FilesParser.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