Showing 3,246 of 4,217 total issues
Function read
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
public function read($filename)
{
// split the file into lines, we'll process it line by line
$config_file = file($filename);
- 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
yf_db
has 99 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_db
{
/** @var string Type of database (default) */
public $DB_TYPE = 'mysql';
/** @var bool Switch caching on/off */
File class_assets_test.Test.php
has 790 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once dirname(__DIR__) . '/yf_unit_tests_setup.php';
class class_assets_test extends PHPUnit\Framework\TestCase
Function conf
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
function conf($name = null, $new_value = null, $_arr_name = '')
{
$_arr_sub = null;
if ( ! $_arr_name) {
$_arr_name = 'CONF';
- 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_auth_user.class.php
has 786 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Special methods for user authentification.
*
File yf_db_migrator.class.php
has 770 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* YF database migrations handler.
*/
File yf_manage_deposit.class.php
has 758 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class yf_manage_deposit
{
public $payment_api = null;
File yf_payment_api__currency.class.php
has 754 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class yf_payment_api__currency
{
public $base = 'UAH';
File yf_locale_editor.class.php
has 752 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Locale, i18n (Internationalization) editor.
*
yf_main
has 92 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_main
{
/**
* @var string Type of initialization @conf_skip
* - user (for user section)
File yf_tpl.class.php
has 746 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Stadard Framework template engine.
*
Function product_edit
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
public function product_edit()
{
$id = (int) $_GET['id'];
$_GET['id'] = $id;
if (empty($id)) {
- 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 load_class_file
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
public function load_class_file($class_name = '', $custom_path = '', $force_storage = '')
{
if (empty($class_name) || $class_name == 'main') {
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 _get_modules_from_files
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
{
$admin_modules_array = [];
$pattern_include = '-f ~/' . preg_quote(ADMIN_MODULES_DIR, '~') . '.*' . preg_quote(YF_CLS_EXT, '~') . '$~';
- 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 class_db_real_mysql_test.Test.php
has 731 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once __DIR__ . '/db_real_abstract.php';
/**
yf_db_query_builder_driver
has 89 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class yf_db_query_builder_driver
{
const REGEX_INLINE_CONDS = '~^([a-z0-9\(\)*_\.]+)[\s]*(=|!=|<>|<|>|>=|<=)[\s]*([a-z0-9_\.]+)$~ims';
const REGEX_IS_NULL = '~^([a-z0-9\(\)*_\.]+)[\s]*(is[\s]+null|is[\s]+not[\s]+null)$~ims';
const REGEX_AS = '~^([a-z0-9\(\)*_\.]+)[\s]+AS[\s]+([a-z0-9_]+)$~ims';
class_db_real_utils_mysql_test
has 89 functions (exceeds 20 allowed). Consider refactoring. Open
class class_db_real_utils_mysql_test extends db_real_abstract
{
public static function _need_skip_test($name)
{
if (main()->is_hhvm()) {
yf_validate
has 89 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_validate
{
/** @var int Minimal nick length */
public $MIN_NICK_LENGTH = 2;
/** @var array Allowed nick symbols (display for user) */
File yf_menus_editor.class.php
has 723 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* System-wide menus editor.
*
Function change_location
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
public function change_location()
{
if ( ! main()->USE_GEO_IP) {
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"