mygento/yandexdelivery

View on GitHub

Showing 262 of 262 total issues

The class Mygento_Yandexdelivery_Model_Resource_Shipment is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Resource_Shipment extends Mage_Core_Model_Resource_Db_Abstract
{

    public function _construct()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Model_Observer is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Observer extends Varien_Object
{

    public function handleSave()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Model_Resource_Shipment_Collection is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Resource_Shipment_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{

    public function _construct()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_IndexController is not named in CamelCase.
Open

class Mygento_Yandexdelivery_IndexController extends Mage_Core_Controller_Front_Action
{

    public function indexAction()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Model_Source_Payment is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Source_Payment
{

    public function toOptionArray()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Model_Source_City is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Source_City
{

    public function toOptionArray()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Model_Source_Unit is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Source_Unit
{

    public function toOptionArray()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Helper_Data is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Helper_Data extends Mage_Core_Helper_Abstract
{

    private $_name = 'yandexdelivery';

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $_name is not named in camelCase.
Open

class Mygento_Yandexdelivery_Helper_Data extends Mage_Core_Helper_Abstract
{

    private $_name = 'yandexdelivery';

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $is_quote is not named in camelCase.
Open

    public function getSizes($items, $is_quote)
    {
        $temporary_dimensions = [];
        $weight = 0;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class Mygento_Yandexdelivery_Model_Carrier_Post is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Carrier_Post extends Mygento_Yandexdelivery_Model_Shipping
{

    protected $_subcode = 'post';

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The parameter $data_string is not named in camelCase.
Open

    public function processApiKeys($data_string) {
        $json = json_decode(trim($data_string));

        if (!$json) {
            return;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class Mygento_Yandexdelivery_Model_Resource_Sender_Collection is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Model_Resource_Sender_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{

    public function _construct()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab is not named in CamelCase.
Open

class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{

    public function _construct()
    {

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $_name is not named in camelCase.
Open

class Mygento_Yandexdelivery_Model_Carrier {

    private $_name = 'yandexdelivery';
    private $_url = 'https://delivery.yandex.ru/api/last/';

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $order_id is not named in camelCase.
Open

    public function deleteOrder($order_id) {
        $result = $this->sendRequest('deleteOrder', ['order_id' => $order_id], true);

        //удаляем запись в БД в случае успеха
        if ($result->status == "ok") {

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

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

    private function processType($response, $type, $request, $result)
    {

        foreach ($response->data as $carrier_offer) {
            $price = $request->getFreeShipping() ? 0 : $carrier_offer->cost;
Severity: Minor
Found in app/code/local/Mygento/Yandexdelivery/Model/Shipping.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 isValidDimensionArr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function isValidDimensionArr($arr)
    {
        if (is_array($arr) and 3 == sizeof($arr)) {
            foreach ($arr as $a) {
                if ((!is_int($a) and ! is_float($a)) or $a < 0.1) {
Severity: Minor
Found in app/code/local/Mygento/Yandexdelivery/Helper/Data.php - About 35 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 collectRates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        Varien_Profiler::start($this->_name . '_collect_rate');

        if (!$this->getType()) {
Severity: Minor
Found in app/code/local/Mygento/Yandexdelivery/Model/Shipping.php - About 35 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 getTypes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTypes($addHypes = false) {
        $types = ['todoor', 'post', 'pickup'];
        $enabled = [];
        foreach ($types as $type) {
            if (Mage::getStoreConfig('carriers/yandexdelivery_' . $type . '/active')) {
Severity: Minor
Found in app/code/local/Mygento/Yandexdelivery/Model/Carrier.php - About 35 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