Showing 87 of 98 total issues
Avoid too many return
statements within this method. Open
case -8: return "تراکنش مورد نظر وجود ندارد.";
Avoid too many return
statements within this method. Open
default: return "خطای نامشخص.";
Avoid too many return
statements within this method. Open
case 0: return "پرداخت انجام نشد.";
Avoid too many return
statements within this method. Open
return "توکن ارسال شده یافت نشد";
Function generateToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function generateToken($isForce = false)
{
if ($isForce === false && $this->cache->has('accessToken')) {
return $this->setAccessToken($this->cache->get('accessToken'));
} elseif ($this->cache->has('refreshToken')) {
- 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 fn_check_callback_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function fn_check_callback_data($params)
{
$result = array();
if (isset($params['state']) && !empty($params['state'])) {
$state = $params['state'];
- 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 verify
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function verify(): ReceiptInterface
{
$token = Request::get('token');
$paymentStatus = Request::get('payment_status');
$data = [
- 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"