File Magento2PlatformOrderDecorator.php
has 945 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MundiPagg\MundiPagg\Concrete;
use Magento\Customer\Model\ResourceModel\CustomerRepository;
Magento2PlatformOrderDecorator
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
class Magento2PlatformOrderDecorator extends AbstractPlatformOrderDecorator
{
/** @var Order */
protected $platformOrder;
Method extractPaymentDataFromMundipaggBilletCreditcard
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractPaymentDataFromMundipaggBilletCreditcard(
$additionalInformation,
&$paymentData, $payment
)
{
Method getRegisteredCustomer
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getRegisteredCustomer($quote)
{
$quoteCustomer = $quote->getCustomer();
$addresses = $quoteCustomer->getAddresses();
Method extractPaymentDataFromMundipaggTwoCreditCard
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractPaymentDataFromMundipaggTwoCreditCard
($additionalInformation, &$paymentData, $payment)
{
$moneyService = new MoneyService();
$indexes = ['first', 'second'];
Method extractBasePaymentData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractBasePaymentData($additionalInformation)
{
$moneyService = new MoneyService();
$identifier = null;
$customerId = null;
Method getItemCollection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItemCollection()
{
$moneyService = new MoneyService();
$quote = $this->getQuote();
$itemCollection = $quote->getItemsCollection();
Method getAddress
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAddress($platformAddress)
{
$address = new Address();
$addressAttributes =
MPSetup::getModuleConfiguration()->getAddressAttributes();
Function extractPaymentDataFromMundipaggTwoCreditCard
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function extractPaymentDataFromMundipaggTwoCreditCard
($additionalInformation, &$paymentData, $payment)
{
$moneyService = new MoneyService();
$indexes = ['first', 'second'];
- 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 extractMultibuyerData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractMultibuyerData(
$prefix,
$additionalInformation,
$index = null
)
Function getAddress
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getAddress($platformAddress)
{
$address = new Address();
$addressAttributes =
MPSetup::getModuleConfiguration()->getAddressAttributes();
- 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 getItemCollection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getItemCollection()
{
$moneyService = new MoneyService();
$quote = $this->getQuote();
$itemCollection = $quote->getItemsCollection();
- 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 getPaymentMethodCollection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPaymentMethodCollection()
{
$payments = $this->getPaymentCollection();
if (empty($payments)) {
Method getGuestCustomer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getGuestCustomer($quote)
{
$guestAddress = $quote->getBillingAddress();
$customer = new Customer();
Function extractBasePaymentData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function extractBasePaymentData($additionalInformation)
{
$moneyService = new MoneyService();
$identifier = null;
$customerId = 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
Function extractPaymentDataFromMundipaggBilletCreditcard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function extractPaymentDataFromMundipaggBilletCreditcard(
$additionalInformation,
&$paymentData, $payment
)
{
- 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 getRegisteredCustomer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getRegisteredCustomer($quote)
{
$quoteCustomer = $quote->getCustomer();
$addresses = $quoteCustomer->getAddresses();
- 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"