src/Notification/Handler.php
File Handler.php
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace HiPay\Wallet\Mirakl\Notification;
use DateTime;
Method handleHiPayNotification
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handleHiPayNotification($xml)
{
if (!$xml) {
return;
}
Method identification
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function identification($hipayId, $date, $status)
{
if ($status) {
$eventName = 'identification.notification.success';
$statusRequest = LogVendorsInterface::SUCCESS;
Function handleHiPayNotification
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function handleHiPayNotification($xml)
{
if (!$xml) {
return;
}
- 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 bankInfoValidation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function bankInfoValidation($vendor, $date, $status)
{
// if status is OK
if ($status) {
$this->mirakl->updateOneVendor(
Method withdrawalValidation
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function withdrawalValidation($hipayId, DateTime $date, $withdrawalId, $status)
{
$operation = $this->operationManager
->findByWithdrawalId($withdrawalId);
Method transferValidation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function transferValidation($transferId, $status, $notificationType)
{
$operation = $this->operationManager->findOneByTransferId($transferId);
if (!$operation) {
Method logOperation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function logOperation($miraklId, $paymentVoucherNumber, $status, $message)
{
$logOperation = $this->logOperationsManager->findByMiraklIdAndPaymentVoucherNumber(
$miraklId,
$paymentVoucherNumber
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EventDispatcherInterface $dispatcher,
LoggerInterface $logger,
OperationManager $operationManager,
VendorManagerInterface $vendorManager,
LogVendorsManagerInterface $logVendorManager,
Method other
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$amount,
$currency,
$label,
$hipayId,
$date,
Function identification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function identification($hipayId, $date, $status)
{
if ($status) {
$eventName = 'identification.notification.success';
$statusRequest = LogVendorsInterface::SUCCESS;
- 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"