Showing 4,217 of 4,217 total issues
Method test_where_like
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_where_like()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function connect($options = [])
{
if ( ! $this->_connection) {
if ( ! $options) {
$options = [
- 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 118.
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 connect($options = [])
{
if ( ! $this->_connection) {
if ( ! $options) {
$options = [
- 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 118.
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 create
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create()
{
@$replace = [] + $_POST;
$_this = $this;
$result = form($replace, ['autocomplete' => 'off'])
Method _collect_vars_in_file
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _collect_vars_in_file($file, $type, $params = [])
{
if ( ! $file) {
return [];
}
Method show
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$all_vars = $this->_get_all_vars();
$total_vars = count((array) $all_vars);
$tr_vars = [];
Method menu
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function menu($data = [], $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
if ($data) {
$data = $this->_recursive_sort_items($data);
Method _api_response
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _api_response()
{
if ( ! $this->ENABLE) {
return null;
}
Method _recursive_get_methods_from_extends
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
{
$extends_file_path = '';
$methods = [];
// TODO: connect plugins
Method _get_cke_config
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_cke_config($params = [])
{
asset('ckeditor-plugin-save');
asset('ckeditor-plugin-autosave');
asset('ckeditor-plugin-html5-video');
Method _track_geo_location
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _track_geo_location()
{
if ( ! $this->TRACK_GEO_LOCATION || ! main()->USE_GEO_IP) {
return false;
}
Method _recursive_get_methods_from_extends
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
{
$extends_file_path = '';
$methods = [];
// TODO: connect plugins
Method list_foreign_keys
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function list_foreign_keys($table, $extra = [], &$error = false)
{
if (is_array($table)) {
$extra = (array) $extra + $table;
$table = '';
Method _render_thead
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _render_thead(&$params, &$a, &$to_hide)
{
$data = &$a['data'];
$thead_attrs = '';
if (isset($params['thead'])) {
Method _get_geo_data_from_db
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_geo_data_from_db($cur_ip = '')
{
$cur_ip = trim(array_pop(explode(',', preg_replace("/[^0-9\.,]/i", '', $cur_ip))));
if (empty($cur_ip)) {
return false;
Method read_file
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read_file($server_info = [], $remote_file = '', $local_file = '')
{
$local_file = trim($local_file);
$remote_file = _class('ssh')->_prepare_path($remote_file);
if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($remote_file)) {
Method exec
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exec($server_info = [], $cmd = '')
{
if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
return false;
}
Method _get_available_widgets_hooks
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_available_widgets_hooks($for_section = 'admin')
{
if ( ! in_array($for_section, ['user', 'admin'])) {
$for_section = 'admin';
}
Method test_validate_custom_error
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_validate_custom_error()
{
$_SERVER['REQUEST_METHOD'] = 'POST';
$params = ['do_not_remove_errors' => 1];
Similar blocks of code found in 4 locations. Consider refactoring. Open
'receiver_type' => [
'name' => 'receiver_type',
'type' => 'enum',
'length' => null,
'decimals' => null,
- 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 117.
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