Showing 15 of 17 total issues
Method init
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'bank_transfers';
$this->_a['verbose'] = 'Bank Transfer';
$this->_a['cols'] = array(
Method init
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'bank_wallets';
$this->_a['verbose'] = 'Bank Wallet';
$this->_a['cols'] = array(
Method init
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'bank_receipt';
$this->_a['cols'] = array(
'id' => array(
Method init
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'bank_backend';
$this->_a['cols'] = array(
'id' => array(
Method create
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($request, $match)
{
// Check amount
$amount = $request->REQUEST['amount'];
if ($amount <= 0.0) {
Method createPayment
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createPayment($request, $match)
{
// Check wallet and permissions to access wallet
Pluf::loadFunction('Pluf_Shortcuts_GetObjectOr404');
$toWallet = Pluf_Shortcuts_GetObjectOr404('Bank_Wallet', $match['parentId']);
Method getExtraParam
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getExtraParam()
{
return array(
array(
'name' => self::ClientID,
Method create
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($receipt)
{
$backend = $receipt->get_backend();
$clientId = $backend->getMeta(self::ClientID, null);
Method getGeneralParam
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGeneralParam()
{
$params = array();
$params[] = array(
'name' => 'title',
Method getExtraParam
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getExtraParam()
{
return array(
array(
'name' => self::ClientID,
Method getPayment
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPayment($request, $match)
{
Pluf::loadFunction('Pluf_Shortcuts_GetObjectOr404');
// Check wallets and permissions to access wallets
$wallet = Pluf_Shortcuts_GetObjectOr404('Bank_Wallet', $match['parentId']);
Method initFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initFields($extra = array())
{
$this->fields['amount'] = new Pluf_Form_Field_Integer(array(
'required' => true,
'label' => 'amount'
Function save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function save($commit = true)
{
if (! $this->isValid()) {
// TODO: maso, 1395: باید از خطای مدل فرم استفاده شود.
throw new \Pluf\Exception('Cannot save the backend from an invalid form.');
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function create($request, $match)
{
// Check amount
$amount = $request->REQUEST['amount'];
if ($amount <= 0.0) {
- 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 getPayment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getPayment($request, $match)
{
Pluf::loadFunction('Pluf_Shortcuts_GetObjectOr404');
// Check wallets and permissions to access wallets
$wallet = Pluf_Shortcuts_GetObjectOr404('Bank_Wallet', $match['parentId']);
- 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"