Showing 65 of 1,795 total issues
Method init
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_order';
$this->_a['verbose'] = 'Shop_Order';
$this->_a['cols'] = array(
File DigiDoki.php
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
use Pluf\Workflow;
/**
* DigiDoki Order manager
Method init
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_orderhistory';
$this->_a['verbose'] = 'Shop Order History';
$this->_a['cols'] = array(
Function get
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function get($request, $match)
{
// Check if service exsit
$item = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['modelId']);
// Extract metafield id or metafield key if id is not provided
- 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 get
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function get($request, $match)
{
// Check if product exsit
$item = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['modelId']);
// Extract metafield id or metafield key if id is not provided
- 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
File Event.php
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
class Shop_Order_Event
{
File DigiDoki.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
class Shop_Order_Event_DigiDoki extends Shop_Order_Event
{
Method init
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_order_item';
$this->_a['verbose'] = 'Shop_OrderItem';
$this->_a['cols'] = array(
Method init
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
parent::init();
$this->_model = 'Shop_Zone';
$this->_a['table'] = 'shop_zone';
Method init
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_category';
$this->_a['verbose'] = 'Shop Category';
$this->_a['cols'] = array(
Method init
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
parent::init();
$this->_a['table'] = 'shop_agency';
$this->_a['model'] = 'Shop_Agency';
Method init
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_order_attachments';
$this->_a['cols'] = array(
// شناسهها
Method init
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_service_metafield';
$this->_a['verbose'] = 'Shop_ServiceMetafield';
$this->_a['cols'] = array(
Method init
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_product_metafield';
$this->_a['verbose'] = 'Shop_ProductMetafield';
$this->_a['cols'] = array(
Method init
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_address';
$this->_a['verbose'] = 'Shop_Address';
$this->_model = 'Shop_Address';
Method transferCommission
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function transferCommission($request, $order)
{
$totalCost = $request->REQUEST['total_cost'];
$spareCost = $request->REQUEST['spare_cost'];
$commission = ($totalCost - $spareCost) * 0.2;
Method init
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
parent::init();
$this->_a['table'] = 'shop_product';
$this->_a['verbose'] = 'Shop_Product';
Method init
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_order_metafields';
$this->_a['verbose'] = 'Shop_OrderMetafield';
$this->_a['cols'] = array(
Method initFields
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function initFields($extra = array())
{
$this->user = $extra['user'];
$this->fields['title'] = new Pluf_Form_Field_Varchar(array(
Method owners
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function owners($request, $match)
{
$agency = Pluf_Shortcuts_GetObjectOr404('Shop_Agency', $match['agencyId']);
$user = new User_Account();
$userTable = Shop_Shortcuts_GetTableName($user);