Showing 4,217 of 4,217 total issues
Method _data_ng
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _data_ng($json = false)
{
$cache = &$this->cache;
$_url = [
'product_view' => url_user(['object' => 'shop', 'action' => 'product', 'id' => 0]),
Method __construct
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($type = 'user', $no_db_connect = false, $auto_init_all = false, $_conf = [])
{
if ( ! isset($this->_time_start)) {
$this->_time_start = microtime(true);
}
Method _update_config
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _update_config($name = '', $no_indexing = false, $no_write = false)
{
$conf_file_path = $this->CONF_PATH . 'sphinx.conf';
if (file_exists($conf_file_path) && ! is_readable($conf_file_path)) {
return _e('Error!. File ' . $conf_file_path . ' is not readable! Please check permissions.');
Method tip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tip($in = null, $extra = [])
{
if ( ! is_array($extra)) {
$extra = [];
}
Method test_with_data_full
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_with_data_full()
{
$data = [
[
'date' => strtotime('2014-08-12 12:03:19 UTC'),
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function yes_no($name = '', $extra = [])
{
if ( ! isset($this->_pair_yes_no)) {
$this->_pair_yes_no = str_replace('class="', 'disabled class="', main()->get_data('pair_yes_no'));
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function allow_deny($name, $extra = [])
{
if ( ! isset($this->_pair_allow_deny)) {
$this->_pair_allow_deny = str_replace('class="', 'disabled class="', main()->get_data('pair_allow_deny'));
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method _currency_rate_load
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _currency_rate_load($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// var
Method _init
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
if ( ! $this->ENABLE) {
return null;
}
Method _get_users_daily_payments
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_users_daily_payments($user_ids = [], $type = 'sum')
{
if ( ! $user_ids) {
return false;
}
Method _get_time_diff_human
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_time_diff_human($seconds, $delimiter = ' ', $need_return = false, $only_text = false, $need_closing_tag = false)
{
$d = [];
$tr = [
'years' => ['лет', 'год', 'года'],
Method upload_dir
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
{
$local_dir = _class('ssh')->_prepare_path($local_dir);
$remote_dir = _class('ssh')->_prepare_path($remote_dir);
if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_dir) || ! strlen($remote_dir)) {
Method test_get_and_limit
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_get_and_limit()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_join
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_join()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function _get_site_current_theme($SITE_INFO = [])
{
$index_file_path = $SITE_INFO['REAL_PATH'] . $this->_index_file_name;
if ( ! file_exists($index_file_path)) {
return false;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function _get_site_current_theme($SITE_INFO = [])
{
$index_file_path = $SITE_INFO['REAL_PATH'] . $this->_index_file_name;
if ( ! file_exists($index_file_path)) {
return false;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File test_globals_vs_class.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
function globals_var($name, $value = null)
{
if ( ! isset($name)) {
Consider simplifying this complex logical expression. Open
if ($in_string) {
for (;;) {
$i = strpos($sql, $string_start, $i);
// No end of string found -> add the current substring to the
// returned array
yf_db_driver_pgsql
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_db_driver_pgsql extends yf_db_driver
{
/** @var @conf_skip */
public $db_connect_id = null;
yf_wrapper_redis
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_wrapper_redis
{
public $name = 'REDIS'; // instance name
public $driver = 'phpredis'; // predis|phpredis