Showing 3,246 of 4,217 total issues
Function checkout_product_revision
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkout_product_revision()
{
$_GET['id'] = (int) ($_GET['id']);
$revision_data = db()->get('SELECT * FROM ' . db('shop_product_revisions') . ' WHERE id=' . $_GET['id']);
if (empty($revision_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
Function checkout_order_revision
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkout_order_revision()
{
$_GET['id'] = (int) ($_GET['id']);
$revision_data = db()->get('SELECT * FROM ' . db('shop_order_revisions') . ' WHERE id=' . $_GET['id']);
if (empty($revision_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
Function _save_csv
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _save_csv($file_name, $data = null)
{
// setlocale( LC_ALL, 'ru_RU.utf8' )
// || setlocale( LC_ALL, 'ru_UA.utf8' )
// || setlocale( LC_ALL, 'en_US.utf8' );
- 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 find_ids
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function find_ids()
{
no_graphics(true);
if ( ! $_POST || ! main()->USER_ID || IS_ADMIN != 1/* || !strlen($_POST['param'])*/) {
echo '';
- 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 scan_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
Method upload_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
Function clear_pattern_child_process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function clear_pattern_child_process()
{
if ( ! isset($_GET['id']) && (int) ($_GET['id'])) {
return t('Empty clear pattern 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 _order_validate_delivery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _order_validate_delivery()
{
$_POST['exp_date'] = $_POST['exp_date_mm'] . $_POST['exp_date_yy'];
$force_ship_type = module('shop')->FORCE_GROUP_SHIP[module('shop')->USER_GROUP];
- 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 _basket_save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _basket_save()
{
if ( ! empty($_POST['quantity']) && ! module('shop')->_basket_is_processed) {
module('shop')->_basket_api()->clean();
$products_ids = [];
- 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 new_revision
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function new_revision($function, $ids, $db_table)
{
if (empty($function) || empty($ids) || empty($db_table)) {
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
Method download_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function download_dir($server_info = [], $remote_dir = '', $local_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
Function _init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _init()
{
if ($this->USE_LOCKING) {
$this->LOCK_FILE_NAME = STORAGE_PATH . $this->LOCK_FILE_NAME;
}
- 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 upload_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
Avoid deeply nested control flow statements. Open
if ( ! $result) {
_re('Server mail error');
}
Function _auto_update_items_orders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _auto_update_items_orders($cat_id)
{
if ( ! $cat_id) {
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
Method scan_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
Function _order_step_do_payment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _order_step_do_payment($FORCE_DISPLAY_FORM = false)
{
$basket_contents = module('shop')->_basket_api()->get_all();
if (module('shop')->FORCE_PAY_METHOD) {
- 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 download_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function download_dir($server_info = [], $remote_dir = '', $local_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
Function _get_parents_for_select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _get_parents_for_select($lang, $skip_id = null)
{
$data = [0 => '-- TOP --'];
foreach ((array) $this->_recursive_get_items($lang) as $id => $info) {
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 chart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function chart($data, $params)
{
if ($params['flash'] == true) {
return $this->chart_flash($data, $params);
}
- 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"