Showing 262 of 262 total issues
Method sign
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sign($data, $method)
{
$data['client_id'] = $this->getConfigData('client_id');
$secretKey = '';
Function getOrderData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getOrderData($order) {
if (Mage::getStoreConfig('carriers/' . $this->_name . '/onlyone')) {
$weight = round(Mage::getStoreConfig('carriers/' . $this->_name . '/oneweight') * 1000 / Mage::getStoreConfig('carriers/' . $this->_name . '/weightunit'), 3);
$dimensions = Mage::helper($this->_name)->getStandardSizes();
- Read upRead up
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 confirmOrder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function confirmOrder($ydId, $senderId, $type, $showAdmin = true)
{
$result = Mage::getModel('yandexdelivery/carrier')->confirmOrders($ydId, $senderId, $type);
- Read upRead up
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
Method getSizes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSizes($items, $is_quote)
{
$temporary_dimensions = [];
$weight = 0;
Method createOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createOrder($orderId, $warehouseId, $senderId, $requisiteId, $date, $street, $house) {
The property $_name is not named in camelCase. Open
class Mygento_Yandexdelivery_Helper_Data extends Mage_Core_Helper_Abstract
{
private $_name = 'yandexdelivery';
- Read upRead up
- Exclude checks
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 $parcel_id is not named in camelCase. Open
public function getSenderParcelDocs($parcel_id) {
return $this->sendRequest('getSenderParcelDocs', ['parcel_id' => $parcel_id], true);
}
- Read upRead up
- Exclude checks
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_Shipment is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Shipment extends Mage_Core_Model_Abstract
{
public function _construct()
{
- Read upRead up
- Exclude checks
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_Type is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Source_Type
{
public function toOptionArray()
{
- Read upRead up
- Exclude checks
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 processApiIds($data_string) {
$json = json_decode(trim($data_string));
$res = Mage::getSingleton('core/resource');
- Read upRead up
- Exclude checks
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 parameter $order_id is not named in camelCase. Open
public function getSenderOrderLabel($order_id) {
return $this->sendRequest('getSenderOrderLabel', ['order_id' => $order_id], true);
}
- Read upRead up
- Exclude checks
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 is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Resource_Sender extends Mage_Core_Model_Resource_Db_Abstract
{
public function _construct()
{
- Read upRead up
- Exclude checks
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_Sender is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Sender extends Mage_Core_Model_Abstract
{
public function _construct()
{
- Read upRead up
- Exclude checks
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_Shipping is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
{
protected $_name = 'yandexdelivery';
protected $_isFixed = false;
- Read upRead up
- Exclude checks
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_Shipment_Grid is not named in CamelCase. Open
class Mygento_Yandexdelivery_Block_Adminhtml_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function _construct()
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The parameter $order_id is not named in camelCase. Open
public function senderOrderStatuses($order_id) {
return $this->sendRequest('getSenderOrderStatuses', ['order_id' => $order_id], true);
}
- Read upRead up
- Exclude checks
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_Warehouse_Collection is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Resource_Warehouse_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
public function _construct()
{
- Read upRead up
- Exclude checks
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_Warehouse is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Resource_Warehouse extends Mage_Core_Model_Resource_Db_Abstract
{
public function _construct()
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The property $_isFixed is not named in camelCase. Open
class Mygento_Yandexdelivery_Model_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
{
protected $_name = 'yandexdelivery';
protected $_isFixed = false;
- Read upRead up
- Exclude checks
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 class Mygento_Yandexdelivery_Model_Source_Attribute is not named in CamelCase. Open
class Mygento_Yandexdelivery_Model_Source_Attribute
{
public function getAllOptions()
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}