Showing 14 of 96 total issues
File female_names.inc.php
has 999 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$female_names = [
'mary',
'patricia',
Function update_maxmind_noaccount
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
function update_maxmind_noaccount($data)
{
require_once __DIR__.'/../../../minfraud/http/src/CreditCardFraudDetection.php';
//require_once ('include/accounts/maxmind/CreditCardFraudDetection.php');
//myadmin_log('maxmind', 'debug', "update_maxmind_noaccount Called", __LINE__, __FILE__);
- 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 update_maxmind
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
function update_maxmind($custid, $ip = false, $ccIdx = false)
{
$custid = (int)$custid;
$good = true;
$new_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"
Further reading
Method update_maxmind
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_maxmind($custid, $ip = false, $ccIdx = false)
{
$custid = (int)$custid;
$good = true;
$new_data = [];
File maxmind.inc.php
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MaxMind Fraud Stuff
*
* API Downloaded @ http://www.maxmind.com/download/ccfd/
Method update_maxmind_noaccount
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_maxmind_noaccount($data)
{
require_once __DIR__.'/../../../minfraud/http/src/CreditCardFraudDetection.php';
//require_once ('include/accounts/maxmind/CreditCardFraudDetection.php');
//myadmin_log('maxmind', 'debug', "update_maxmind_noaccount Called", __LINE__, __FILE__);
Method maxmind_lookup
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maxmind_lookup($customer, $ip = false)
{
$mf = new MinFraud(MAXMIND_USER_ID, MAXMIND_LICENSE_KEY);
$data = $GLOBALS['tf']->accounts->read($customer);
$request = $mf->withDevice([
Method get_maxmind_field_descriptions
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_maxmind_field_descriptions()
{
$fields = [
'distance' => 'Distance from IP address location to billing location in kilometers (large distance = higher risk).',
'countryMatch' => 'Whether country of IP address matches billing address country (mismatch = higher risk).',
Method view_maxmind
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function view_maxmind()
{
require_once __DIR__.'/maxmind.inc.php'; // This handles fraud protection
page_title('MaxMind Credit Fraud Output');
function_requirements('has_acl');
Method maxmind_compare
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maxmind_compare()
{
function_requirements('has_acl');
if ($GLOBALS['tf']->ima != 'admin' || !has_acl('view_customer')) {
dialog('Not admin', 'Not Admin or you lack the permissions to view this page.');
Function maxmind_compare
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function maxmind_compare()
{
function_requirements('has_acl');
if ($GLOBALS['tf']->ima != 'admin' || !has_acl('view_customer')) {
dialog('Not admin', 'Not Admin or you lack the permissions to view this page.');
- 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 maxmind_lookup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function maxmind_lookup($customer, $ip = false)
{
$mf = new MinFraud(MAXMIND_USER_ID, MAXMIND_LICENSE_KEY);
$data = $GLOBALS['tf']->accounts->read($customer);
$request = $mf->withDevice([
- 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
Consider simplifying this complex logical expression. Open
if ((MAXMIND_CARDER_LOCK == true && isset($response['carderEmail']) && $response['carderEmail'] == 'Yes') || (isset($response['score']) && $response['score'] >= MAXMIND_SCORE_LOCK) || $response['riskScore'] >= MAXMIND_RISKSCORE_LOCK) {
$db->query("select * from invoices where invoices_type=1 and invoices_paid=1 and invoices_custid={$custid} and invoices_date <= date_sub(now(), INTERVAL 1 DAY) limit 1", __LINE__, __FILE__);
if ($db->num_rows() == 0) {
myadmin_log('maxmind', 'warning', "update_maxmind({$custid}, {$ip}) Carder Email Or High Score From Customer {$custid} (".(isset($response['score']) ? 'Score: '.$response['score'] : '')." RiskScore {$response['riskScore']}), Disabling Account", __LINE__, __FILE__);
function_requirements('disable_account');
Function view_maxmind
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function view_maxmind()
{
require_once __DIR__.'/maxmind.inc.php'; // This handles fraud protection
page_title('MaxMind Credit Fraud Output');
function_requirements('has_acl');
- 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"