Showing 16 of 16 total issues
File migrationChecker.php
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Certifique-se de inserir este arquivo na raiz do seu projeto, para que possa validar todos os arquivos
* e de inserir corretamente o caminho para os arquivos do autoload do Composer na linha 55.
Function map
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function map($method)
{
if (!isset($this->endpoints['ENDPOINTS'])) {
if (array_column($this->endpoints['PIX'], $method)) {
$this->endpoints = $this->endpoints['PIX'];
- 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 verifyCertificate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function verifyCertificate($certificate)
{
if ($this->certified_path) {
$this->client->setDefaultOption('verify', $this->certified_path);
}
- 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 getMissingPackages
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function getMissingPackages(): array
{
$missingPackages = [];
foreach (self::REQUIRED_PACKAGES as $package => $version) {
- 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 getCorrections
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function getCorrections(): array
{
$corrections = [];
foreach ($this->getPhpFiles() as $filePath) {
- 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 send
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function send($method, $route, $requestOptions)
{
try {
if (isset($this->config['certificate'])) {
$requestOptions['cert'] = $this->verifyCertificate($this->config['certificate']);
- 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 map
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function map($method)
{
if (!isset($this->endpoints['ENDPOINTS'])) {
if (array_column($this->endpoints['PIX'], $method)) {
$this->endpoints = $this->endpoints['PIX'];
Method send
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($method, $route, $requestOptions)
{
try {
if (isset($this->config['certificate'])) {
$requestOptions['cert'] = $this->verifyCertificate($this->config['certificate']);
Method getCorrections
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCorrections(): array
{
$corrections = [];
foreach ($this->getPhpFiles() as $filePath) {
Method verifyCertificate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function verifyCertificate($certificate)
{
if ($this->certified_path) {
$this->client->setDefaultOption('verify', $this->certified_path);
}
Method options
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function options($options)
{
$conf = [];
$conf['sandbox'] = isset($options['sandbox']) ? $options['sandbox'] : false;
$conf['debug'] = isset($options['debug']) ? $options['debug'] : false;
Method send
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($method, $route, $body)
{
if (!$this->auth->expires || $this->auth->expires <= time()) {
$this->auth->authorize();
}
Function checkSDKInstallation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function checkSDKInstallation(): array
{
$resultSdkInfo = [];
foreach ($this->installedPackages['packages'] as $package) {
if ($package['name'] === 'efipay/sdk-php-apis-efi' || $package['name'] === 'gerencianet/gerencianet-sdk-php') {
- 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 apiReturns
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function apiReturns($error, $code){
if (isset($error['message'])) {
$message = $error['message'];
$this->code = $code;
- 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 CRC16Checksum
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function CRC16Checksum($str)
{
$crc = 0xFFFF;
$strlen = strlen($str);
for ($c = 0; $c < $strlen; $c++) {
- 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 options
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function options($options)
{
$conf = [];
$conf['sandbox'] = isset($options['sandbox']) ? $options['sandbox'] : false;
$conf['debug'] = isset($options['debug']) ? $options['debug'] : 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"