Showing 65 of 1,795 total issues
Method init
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_tax_class';
$this->_a['verbose'] = 'Shop_TaxClass';
$this->_a['cols'] = array(
Method getGeneralParam
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getGeneralParam()
{
$params = array();
$params[] = array(
'name' => 'title',
Method init
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
// $this->_a['table'] = 'shop_detailedobject';
// $this->_a['verbose'] = 'Shop_DetailedObject';
$this->_a['cols'] = array(
Method init
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_contact';
$this->_a['verbose'] = 'Shop_Contact';
$this->_a['multitenant'] = false;
Method members
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function members($request, $match)
{
$zone = Pluf_Shortcuts_GetObjectOr404('Shop_Zone', $match['zoneId']);
$user = new User_Account();
$associationTable = Shop_Shortcuts_GetAssociationTableName($zone, $user);
Method find
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function find($request, $match)
{
$order = new Shop_Order();
$pag = new Pluf_Paginator($order);
$manager = $order->getManager();
Method init
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
// $this->_a['table'] = 'shop_pricedobject';
// $this->_a['verbose'] = 'Shop_PricedObject';
parent::init();
Method init
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_category_metafields';
$this->_a['verbose'] = 'Shop_CategoryMetafield';
$this->_a['cols'] = array(
Method init
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_order_item_metafields';
$this->_a['verbose'] = 'Shop_OrderItemMetafield';
$this->_a['cols'] = array(
Method pay
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function pay($request, $match)
{
/**
*
* @var Shop_Order $order
Method init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init()
{
$this->_a['table'] = 'shop_tag';
$this->_a['verbose'] = 'Shop Tag';
$this->_a['cols'] = array(
Method find
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function find($request, $match)
{
if (isset($match['secureId'])) {
$order = Shop_Shortcuts_GetObjectBySecureIdOr404('Shop_Order', $match['secureId']);
} else {
Method items
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function items($request, $match)
{
$category = Pluf_Shortcuts_GetObjectOr404('Shop_Category', $match['categoryId']);
$model = Shop_Views_Category::itemModel($request, $match);
$item = Pluf::factory($model);
Method categories
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function categories($request, $match, $p)
{
$model = $p['model'];
$item = Pluf_Shortcuts_GetObjectOr404($model, $match['modelId']);
$category = new Shop_Category();
Method sendSms
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function sendSms($data)
{
// Mobile number
$receiver = array_key_exists('receiver', $data) ? $data['receiver'] : null;
if (! $receiver) {
Method tags
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function tags($request, $match, $p)
{
$model = $p['model'];
$item = Pluf_Shortcuts_GetObjectOr404($model, $match['modelId']);
$tag = new Shop_Tag();
Function createOrderFilter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function createOrderFilter($request)
{
$sql = new Pluf_SQL('deleted=%d', array(
FALSE
));
- 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 items
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function items($request, $match)
{
$tag = Pluf_Shortcuts_GetObjectOr404('Shop_Tag', $match['tagId']);
$model = Shop_Views_Tag::itemModel($request, $match);
$item = Pluf::factory($model);
Method productTaxes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function productTaxes ($request, $match)
{
$product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
$tax = new Shop_TaxClass();
$taxTable = $tax->_a['table'];
Method getStates
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getStates()
{
return array(
Workflow\Machine::STATE_UNDEFINED => array(
'next' => 'Live'