Showing 3,246 of 4,217 total issues
Method _create_cloud
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _create_cloud($cloud_data = [], $params = [])
{
if (empty($cloud_data)) {
return '';
}
Method feedback
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function feedback()
{
if (empty($_SESSION[$_GET['object'] . '__feedback'])) {
$_SESSION[$_GET['object'] . '__feedback'] = [
'order_by' => 'add_date',
Method checkout_images_revision
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkout_images_revision()
{
$_GET['id'] = (int) ($_GET['id']);
$revision_data = db()->get('SELECT * FROM ' . db('shop_product_images_revisions') . ' WHERE id=' . $_GET['id']);
if (empty($revision_data)) {
Method basket_main
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function basket_main()
{
$products_ids = [];
$basket_contents = module('shop')->_basket_api()->get_all();
foreach ((array) $basket_contents as $_item_id => $_info) {
Method _api_upload
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _api_upload()
{
$file = $_FILES['file'];
if (empty($file) || $file['error'] != UPLOAD_ERR_OK) {
$this->_reject('PHP: Entity Too Large', '500 Internal Server Error', 500);
Method preview
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preview($extra = [])
{
conf('ROBOTS_NO_INDEX', true);
no_graphics(true);
if (main()->USER_ID != 1) {
Method _track_error
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _track_error($error_message = '')
{
if (empty($error_message)) {
return false;
}
Method confirm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function confirm()
{
// Send registration confirmation email
if ( ! $this->CONFIRM_REGISTER) {
return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_not_needed']);
Method _show_form
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_form()
{
// Already logged in users not needed to login again
if (main()->USER_ID) {
return js_redirect($this->DEF_REDIRECT_URL);
Method chart_flash
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chart_flash($data, $params)
{
if (empty($data)) {
return;
}
Method check
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function check($field_in_form = 'image_numbers', $input = null)
{
if ( ! $this->ENABLED) {
return true;
}
Method create_models_alternate_methods
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_models_alternate_methods()
{
try {
// Method 2
$bear_cool1 = model('bear')->create([
Method test_has_many_through
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_has_many_through()
{
$model_base = _class('model');
$m = __FUNCTION__ . '_model';
$t_countries = __FUNCTION__ . '_countries';
Method test_order6
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_order6()
{
$jquery_url = _class('assets')->get_asset('jquery', 'js');
$url = $jquery_url;
$url1 = $url . '?v=1';
Method test_simple
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_simple()
{
$this->assertEquals('', common()->_propose_url_from_name());
$this->assertEquals('', common()->_propose_url_from_name(false));
$this->assertEquals('', common()->_propose_url_from_name([]));
Method _attrs
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _attrs($extra, $names)
{
$body = [];
$a = [];
foreach ((array) $names as $name) {
Function _get_daily_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function _get_daily_data($days = null)
{
$time = time();
$days = $days ?: 60;
$min_time = $time - $days * 86400;
- 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_daily_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function _get_daily_data($days = null)
{
$time = time();
$days = $days ?: 60;
$min_time = $time - $days * 86400;
- 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 change_location_result
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function change_location_result()
{
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"
Further reading
Function time_box2
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function time_box2($name, $selected = '', $add_str = '', $show_text = 1, $translate = 1)
{
if (is_array($selected)) {
$extra = (array) $extra + $name;
$name = $extra['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"