Showing 3,246 of 4,217 total issues
Method product_revisions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function product_revisions()
{
$filter_params = [
'name' => ['like', 'p.name'],
'action' => ['eq', 'r.action'],
Method order_revisions_view
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function order_revisions_view()
{
$sql = 'SELECT * FROM ' . db('shop_order_revisions') . ' WHERE id=' . (int) ($_GET['id']);
$a = db()->get($sql);
$order_info = db()->get('SELECT * FROM ' . db('shop_orders') . ' WHERE id=' . $a['item_id']);
Method product_revisions_view
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function product_revisions_view()
{
$sql = 'SELECT * FROM ' . db('shop_product_revisions') . ' WHERE id=' . (int) ($_GET['id']);
$a = db()->get($sql);
$product_info = module('manage_shop')->_product_get_info($a['item_id']);
Method chart
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function chart($data, $params)
{
if ($params['flash'] == true) {
return $this->chart_flash($data, $params);
}
Method init_server_id
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function init_server_id()
{
$this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
$servers = $this->get_data('servers');
$this->SERVER_ID = 0;
Method create_image_versions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function create_image_versions($uploads_result = null, $options = null)
{
if ( ! is_array($uploads_result) || ! is_array($options['image_versions'])) {
return false;
}
Method scan_dir
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function scan_dir($start_dir, $_tmp = 1, $pattern_include = '', $pattern_exclude = '')
{
$func = __FUNCTION__;
// Here we accept several start folders, result will be merged
if (is_array($start_dir)) {
Method test_replace_safe
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_replace_safe()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method grid
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function grid()
{
return _class('html')->grid([
[
['s1'],
Method _check_location
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _check_location($cur_country = '', $cur_region = '', $cur_city = '')
{
// TODO: rewrite me
if (FEATURED_COUNTRY_SELECT && ! empty($_POST['country']) && substr($_POST['country'], 0, 2) == 'f_') {
$_POST['country'] = substr($_POST['country'], 2);
Method test_add_foreign_key
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_add_foreign_key()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_min
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_min()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_chunk
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_chunk()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_max
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_max()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_sum
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_sum()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_group_by
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_group_by()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_avg
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_avg()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_execute()
{
$class = get_called_class();
$method = 'return_true';
$this->assertEquals('true', self::_tpl('{execute(' . $class . ',' . $method . ')}'));
Function cache_fill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function cache_fill()
{
$this->cache_purge();
// TODO: use temp dir while caching
// TODO: verify that all files are available
- 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 multi_get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function multi_get(array $names, $ttl = 0, $params = [])
{
if ( ! $this->is_ready()) {
return null;
}
- 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"