Showing 3,246 of 4,217 total issues
Function render_type_slide
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function render_type_slide($params = [])
{
$total_records = $params['total_records'];
$per_page = $params['per_page'];
$requested_page = $params['requested_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 url_to_absolute
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function url_to_absolute($baseUrl, $relativeUrl)
{
// Remove several frag parts from URL
if (substr_count($baseUrl, '#') > 1) {
$baseUrl = substr($baseUrl, 0, strpos($baseUrl, '#', strpos($baseUrl, '#') + 1));
- 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 split_url
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function split_url($url, $decode = false)
{
// Character sets from RFC3986.
$xunressub = 'a-zA-Z\d\-._~\!$&\'()\[\]*+,;=\|';
$xpchar = $xunressub . ':@%';
- 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 _order_create
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function _order_create()
{
if (empty($_POST)) {
return 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"
Further reading
Function my_array_merge
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function my_array_merge($a1, $a2)
{
foreach ((array) $a2 as $k => $v) {
if (isset($a1[$k]) && is_array($a1[$k])) {
if (is_array($a2[$k])) {
- 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
File yf_manage_shop_attributes.class.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class yf_manage_shop_attributes
{
public function attributes()
Method start
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function start()
{
$main = main();
if ( ! empty($this->_started) || $main->is_console() || conf('SESSION_OFF') || $this->OFF) {
return false;
Method _transaction
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _transaction($options)
{
if ( ! $this->ENABLE) {
return null;
}
Method create_table
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_table($table, $extra = [], &$error = false)
{
// Example callable: create_table($name, function($t) { $t->int('id', 10); });
if (is_callable($extra)) {
if (strpos($table, '.') !== false) {
File yf_payment_api__provider_bitcoin.class.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
_class('payment_api__provider_remote');
class yf_payment_api__provider_bitcoin extends yf_payment_api__provider_remote
File yf_wrapper_ethereum.class.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Ethereum API wrapper.
*/
File pack_zend.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
//-----------------------------------------------------------
// settings
//-----------------------------------------------------------
Method _api_Interkassa
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _api_Interkassa($title)
{
$php = '';
$api = _class('payment_api__provider_interkassa');
$methods = [
Method _external_response
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _external_response()
{
$ip = common()->get_ip();
if ( ! in_array($ip, ['185.71.65.92', '185.71.65.189', '149.202.17.210'])) {
$this->external_response_errors[] = 'Invalid sender IP address ' . $ip;
Method split_url
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function split_url($url, $decode = false)
{
// Character sets from RFC3986.
$xunressub = 'a-zA-Z\d\-._~\!$&\'()\[\]*+,;=\|';
$xpchar = $xunressub . ':@%';
Method product_details
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function product_details()
{
if ( ! $_GET['id']) {
return is_redirect('./?object=shop');
}
File forum_posts.data.php
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
return [
22 => [
'id' => '22',
Method _get_current_lang
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_current_lang($force = false)
{
$langs = $this->LANGUAGES ?: $this->_get_langs();
$FORCE_LOCALE = conf('FORCE_LOCALE');
Method _on_validate_ok
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _on_validate_ok($params = [], $form = null)
{
$p = $params ?: $_POST;
$lang = $p['lang_to'];
$lang_from = $p['lang_from'] ?: 'en';
Method currency_rates_current
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function currency_rates_current()
{
$result = [];
$payment_api = _class('payment_api');
// conversion UNT to UAH