Function checkQuoteItemQty
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
public function checkQuoteItemQty($observer)
{
$quoteItem = $observer->getEvent()->getItem();
/* @var $quoteItem Mage_Sales_Model_Quote_Item */
if(!$quoteItem || !$quoteItem->getProductId() || !$quoteItem->getQuote()
- Read upRead up
- Create a ticketCreate a ticket
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 checkQuoteItemQty
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkQuoteItemQty($observer)
{
$quoteItem = $observer->getEvent()->getItem();
/* @var $quoteItem Mage_Sales_Model_Quote_Item */
if(!$quoteItem || !$quoteItem->getProductId() || !$quoteItem->getQuote()
- Create a ticketCreate a ticket
File Observer.php
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Class Demac_MultiLocationInventory_Model_CatalogInventory_Observer
*/
class Demac_MultiLocationInventory_Model_CatalogInventory_Observer extends Mage_CatalogInventory_Model_Observer
- Create a ticketCreate a ticket
Method refundOrderInventory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function refundOrderInventory($observer)
{
/* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
$creditmemo = $observer->getEvent()->getCreditmemo();
$items = array();
- Create a ticketCreate a ticket
Method cancelOrderItem
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cancelOrderItem($observer)
{
$item = $observer->getEvent()->getItem();
$children = $item->getChildrenItems();
- Create a ticketCreate a ticket
Function refundOrderInventory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function refundOrderInventory($observer)
{
/* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
$creditmemo = $observer->getEvent()->getCreditmemo();
$items = array();
- Read upRead up
- Create a ticketCreate a ticket
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 _loopCancelItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _loopCancelItem($args)
{
$productId = $args['product_id'];
$row = $args['row'];
- Create a ticketCreate a ticket
Function _loopCancelItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function _loopCancelItem($args)
{
$productId = $args['product_id'];
$row = $args['row'];
- Read upRead up
- Create a ticketCreate a ticket
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"