Showing 86 of 191 total issues
Method search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function search(Credentials $credentials, $code)
{
Logger::info("Begin", ['service' => 'PreApproval.Search.Code']);
Method search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function search(Credentials $credentials, $code)
{
Logger::info("Begin", ['service' => 'Application.Search.Notification']);
try {
$connection = new Connection\Data($credentials);
Method create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function create(Credentials $credentials, QueryPaymentOrder $queryPaymentOrder)
{
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
Method search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function search(Credentials $credentials, $code)
{
Logger::info("Begin", ['service' => 'Application.Search.Code']);
try {
$connection = new Connection\Data($credentials);
Method getData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getData(Requests $request, $properties)
{
$data = [];
$items = $request->getItems();
if ($request->itemLenght() > 0) {
Method search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function search(Credentials $credentials, $code)
{
Logger::info("Begin", ['service' => 'PreApproval.Search.Notification']);
try {
$connection = new Connection\Data($credentials);
Method create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function create(Credentials $credentials, $code)
{
Logger::info("Begin", ['service' => 'Cancel']);
try {
$connection = new Connection\Data($credentials);
Method create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function create(Credentials $credentials, $code, $value = null)
{
Logger::info("Begin", ['service' => 'Refund']);
try {
$connection = new Connection\Data($credentials);
Method success
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function success(Http $http)
{
$xml = simplexml_load_string($http->getResponse());
$response = new Response();
Method success
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function success(Http $http)
{
$xml = simplexml_load_string($http->getResponse());
$response = new Response();
$response->setName(current($xml->name))
Function mask
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private static function mask($value, $mask)
{
$maskared = '';
$key = 0;
for ($count = 0; $count <= strlen($mask) - 1; $count++) {
- 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
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function check(Credentials $credentials)
{
Logger::info("Begin", ['service' => 'Application.Notification']);
try {
$connection = new Connection\Data($credentials);
Method check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function check(Credentials $credentials)
{
Logger::info("Begin", ['service' => 'Transactions.Notification']);
try {
$connection = new Connection\Data($credentials);
Method makeAddressNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function makeAddressNode(\DOMNode $personDom)
{
$addressElement = $this->dom->createElement('address');
$addressDom = $personDom->appendChild($addressElement);
Method address
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function address($request, $properties)
{
$data = [];
if (!is_null($request->getStreet())) {
Method makeAddressNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function makeAddressNode(\DOMNode $companyDom)
{
$addressElement = $this->dom->createElement('address');
$addressDom = $companyDom->appendChild($addressElement);
Method makeAddressNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function makeAddressNode(\DOMNode $personDom)
{
$addressElement = $this->dom->createElement('address');
$addressDom = $personDom->appendChild($addressElement);
Method address
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function address($request, $properties)
{
$data = [];
if (!is_null($request->getShipping()->getAddress()->getStreet())) {
$data[$properties::SHIPPING_ADDRESS_STREET] = $request->getShipping()->getAddress()->getStreet();
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function create(Credentials $credentials, \PagSeguro\Domains\Requests\PreApproval\Charge $charge)
{
Logger::info("Begin", ['service' => 'PreApproval.Charge']);
try {
$connection = new Connection\Data($credentials);
Method withParameters
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$street,
$number,
$district,
$postalCode,
$city,