lovata/oc-shopaholic-plugin

View on GitHub

Showing 396 of 402 total issues

Variable "parent_id" is not in valid camel caps format
Open

        if (!empty($obCategoryItem->parent_id)) {
Severity: Minor
Found in components/Breadcrumbs.php by phpcodesniffer

Doc comment for parameter "$iSiteID" missing
Open

    /**

Exception type missing for @throws tag in function comment
Open

     * @throws

Expected 1 space after FUNCTION keyword; 0 found
Open

        $arElementIDList = (array) Product::whereHas('site', function($obQuery) {

Variable "old_price_value" is not in valid camel caps format
Open

        if ($this->old_price_value > 0) {
Severity: Minor
Found in models/Price.php by phpcodesniffer

Missing @return tag in function comment
Open

     */
Severity: Minor
Found in controllers/Brands.php by phpcodesniffer

Missing @return tag in function comment
Open

     */
Severity: Minor
Found in controllers/Products.php by phpcodesniffer

Blank line found at start of control structure
Open

        if ($obItem instanceof Offer) {

Missing parameter name
Open

     * @param $obProgressBar

Exception type missing for @throws tag in function comment
Open

     * @throws

Doc comment for parameter "$arAddParamList" missing
Open

    /**

Variable "old_price_without_tax_value" is not in valid camel caps format
Open

        $fPrice = PriceHelper::round($this->old_price_with_tax_value - $this->old_price_without_tax_value);
Severity: Minor
Found in classes/item/OfferItem.php by phpcodesniffer

Variable "discount_price_value" is not in valid camel caps format
Open

        $fPrice = TaxHelper::instance()->getPriceWithTax($this->discount_price_value, $this->tax_percent);
Severity: Minor
Found in classes/item/OfferItem.php by phpcodesniffer

Variable "old_price_value" is not in valid camel caps format
Open

                'old_price' => $obPrice->old_price_value,
Severity: Minor
Found in models/Offer.php by phpcodesniffer

Variable "old_price" is not in valid camel caps format
Open

            $obPriceModel->old_price = $fOldPrice !== null ? $fOldPrice : $obPriceModel->old_price;
Severity: Minor
Found in models/Offer.php by phpcodesniffer

Doc comment for parameter "$obProgressBar" missing
Open

    /**

Doc comment for parameter "$obProgressBar" missing
Open

    /**

Expected 1 space after FUNCTION keyword; 0 found
Open

        $arElementIDList = (array) Category::whereHas('site', function($obQuery) {

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

<?php namespace Lovata\Shopaholic\Classes\Store\Tax;

use Lovata\Toolbox\Classes\Store\AbstractStoreWithoutParam;

use Lovata\Shopaholic\Models\Tax;
Severity: Major
Found in classes/store/tax/ActiveListStore.php and 7 other locations - About 30 mins to fix
classes/store/brand/ActiveListStore.php on lines 1..26
classes/store/category/ActiveListStore.php on lines 1..26
classes/store/currency/ActiveListStore.php on lines 1..26
classes/store/offer/ActiveListStore.php on lines 1..26
classes/store/promoblock/ActiveListStore.php on lines 1..36
classes/store/promoblock/HiddenListStore.php on lines 1..35
classes/store/promoblock/NotHiddenListStore.php on lines 1..35

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 46.

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 8 locations. Consider refactoring.
Open

<?php namespace Lovata\Shopaholic\Classes\Store\PromoBlock;

use Lovata\Toolbox\Classes\Store\AbstractStoreWithoutParam;

use Lovata\Shopaholic\Models\PromoBlock;
Severity: Major
Found in classes/store/promoblock/ActiveListStore.php and 7 other locations - About 30 mins to fix
classes/store/brand/ActiveListStore.php on lines 1..26
classes/store/category/ActiveListStore.php on lines 1..26
classes/store/currency/ActiveListStore.php on lines 1..26
classes/store/offer/ActiveListStore.php on lines 1..26
classes/store/promoblock/HiddenListStore.php on lines 1..35
classes/store/promoblock/NotHiddenListStore.php on lines 1..35
classes/store/tax/ActiveListStore.php on lines 1..26

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 46.

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