Showing 4,217 of 4,217 total issues
Method _db_get
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _db_get($options)
{
$cache = &$this->cache;
$_ = $options;
$_name = $_['name'];
Method _perm_str2num
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _perm_str2num($perm = '')
{
$perm_len = strlen(trim($perm));
if ($perm_len > 10 && $perm_len < 9) {
return false;
Method find_ids
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function find_ids()
{
no_graphics(true);
if ( ! $_POST || ! main()->USER_ID || IS_ADMIN != 1/* || !strlen($_POST['param'])*/) {
echo '';
Method _get_nav_by_item_id
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_nav_by_item_id($item_id = 0, $cat_items = [], $STPL_NAME = '', $prepare_link_callback = null)
{
if (empty($STPL_NAME)) {
$STPL_NAME = __CLASS__ . '/nav_item';
}
Method attribute_add
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function attribute_add()
{
if (main()->is_post()) {
if (empty($_POST['title'])) {
_re('Title is required');
Method _order_step_select_payment
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _order_step_select_payment($FORCE_DISPLAY_FORM = false)
{
// Show previous form if needed
if (common()->_error_exists() || empty($_POST)) {
return module('shop')->_order_step_delivery();
Method show_items
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_items()
{
$cat_info = db()->get('SELECT * FROM ' . db('categories') . ' WHERE name="' . db()->es($_GET['id']) . '" OR id=' . (int) ($_GET['id']));
if ( ! $cat_info) {
return _e('No such category');
Method _upload_item__import
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _upload_item__import($options)
{
$_ = $options;
$id = $_['id'];
$upload_list = $this->upload_list;
Method _debug_redis
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _debug_redis(&$params = [])
{
if ( ! $this->SHOW_REDIS_INFO) {
return '';
}
Method init_class
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init_class($class_name, $custom_path = '', $params = '')
{
$class_name = $this->get_class_name($class_name);
if (isset($this->modules[$class_name]) && is_object($this->modules[$class_name])) {
return $this->modules[$class_name];
Method _connect
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _connect()
{
if (isset($this->sphinx_connection)) {
return $this->sphinx_connection;
}
Method test_yf_db_installer_basic
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_yf_db_installer_basic()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method create_tables
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_tables()
{
try {
self::utils()->create_table('bears', function ($t) {
$t->increments('id')
Method test_complex
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_complex()
{
$data = [
'a_variable' => 'var_value',
'navigation' => [
Method send_mail
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
public function send_mail($email_from, $name_from = '', $email_to = '', $name_to = '', $subject = '', $text = '', $html = '', $attaches = [], $charset = '', $old_param1 = '', $force_mta_opts = [], $priority = null, $smtp = [])
Similar blocks of code found in 5 locations. Consider refactoring. Open
$data = [
['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
['key' => 'primary', 'key_cols' => 'id'],
- 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 113.
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
<?php
return [
1 => [
'id' => '1',
- 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 113.
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 5 locations. Consider refactoring. Open
$data = [
['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
['key' => 'primary', 'key_cols' => 'id'],
- 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 113.
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 5 locations. Consider refactoring. Open
$data = [
['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
['key' => 'primary', 'key_cols' => 'id'],
- 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 113.
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 5 locations. Consider refactoring. Open
$in = [
['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
['key' => 'primary', 'key_cols' => 'id'],
- 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 113.
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