File yf_payment_api__provider_bitaps.class.php
has 632 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
_class('payment_api__provider_remote');
class yf_payment_api__provider_bitaps extends yf_payment_api__provider_remote
Function _external_response
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function _external_response($options)
{
$operation_id = $options['operation_id'];
$payment_code = $options['code'] ?: '';
$address = $options['address'] ?: '';
- 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 api_payout
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function api_payout($options = null)
{
if ( ! $this->ENABLE) {
return null;
}
Method _external_response
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _external_response($options)
{
$operation_id = $options['operation_id'];
$payment_code = $options['code'] ?: '';
$address = $options['address'] ?: '';
Method deposition
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deposition($options)
{
if ( ! $this->ENABLE) {
return null;
}
Function _check_operations
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function _check_operations($type = 'payout')
{
$payment_api = &$this->payment_api;
$successful_operations = [];
switch ($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
Function _check_payout_operation
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function _check_payout_operation($operation_id)
{
$payment_api = &$this->payment_api;
$operation = $payment_api->operation(['operation_id' => $operation_id]);
$address = $operation['options']['request'][0]['options']['address'] ?: 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
Function api_payout
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function api_payout($options = null)
{
if ( ! $this->ENABLE) {
return null;
}
- 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 _check_payout_operation
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _check_payout_operation($operation_id)
{
$payment_api = &$this->payment_api;
$operation = $payment_api->operation(['operation_id' => $operation_id]);
$address = $operation['options']['request'][0]['options']['address'] ?: false;
Method _api_response
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _api_response($options)
{
$operation_id = isset($_GET['operation_id']) ? (int) ($_GET['operation_id']) : '';
$this->payment_api->dump(['name' => ucfirst($this->PROVIDER_NAME), 'operation_id' => $operation_id]);
// import options
Method _check_operations
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _check_operations($type = 'payout')
{
$payment_api = &$this->payment_api;
$successful_operations = [];
switch ($type) {
Avoid deeply nested control flow statements. Open
if ($real_payment_code == $payment_code && $confirmations >= $this->CONFIRMATIONS && $real_address == $address) {
$need_update_amount = false;
$request_amount_currency_satoshi = $operation['options']['request']['amount_currency_satoshi'];
$request_fee = $operation['options']['request']['fee'];
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $result;
Function deposition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deposition($options)
{
if ( ! $this->ENABLE) {
return null;
}
- 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"