Showing 4,217 of 4,217 total issues
Method __api_response__result
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __api_response__result($operation_id, $response)
{
if ( ! $this->ENABLE) {
return null;
}
Method edit_stpl
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit_stpl()
{
$theme_name = $_GET['theme'];
$stpl_name = $_GET['name'];
if ( ! validate([$theme_name, $stpl_name], 'trim|required')) {
Method form_begin
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function form_begin($name = '', $method = '', $extra = [], $replace = [])
{
if (is_array($name)) {
$extra = (array) $extra + $name;
$name = '';
Method _validate_rules_process
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _validate_rules_process($validate_rules = [], &$data)
{
$validate_ok = true;
foreach ((array) $validate_rules as $name => $rules) {
$is_required = false;
Method postload
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postload($params = [], $table)
{
$attr_postload_url = $params['attr_postload_url'] ?: 'postload-url';
$tr_id_key = $params['tr_id_key'] ?: 'name';
Method get_shard_table_name
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_shard_table_name($table_name, $db)
{
$shard_table_name = '';
// Try sharding by year/month/day (example: db('currency_pairs_log_2013_07_01') from db('currency_pairs_log'))
if ( ! $shard_table_name && $this->SHARDING_BY_DAY) {
Method url_to_absolute
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function url_to_absolute($baseUrl, $relativeUrl)
{
// Remove several frag parts from URL
if (substr_count($baseUrl, '#') > 1) {
$baseUrl = substr($baseUrl, 0, strpos($baseUrl, '#', strpos($baseUrl, '#') + 1));
Method manufacturer_edit
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function manufacturer_edit()
{
$_GET['id'] = (int) ($_GET['id']);
if (empty($_GET['id'])) {
return _e('Empty ID!');
Method attribute_edit
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function attribute_edit()
{
if (empty($_GET['id'])) {
return _e('no id');
}
Method _get_git_details
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_git_details($FS_PATH, $as_submodule = false)
{
$git_base_path = $FS_PATH . '.git';
if ( ! file_exists($git_base_path)) {
return [];
Method _do_rewrite
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _do_rewrite()
{
$this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
if ($this->is_console() || MAIN_TYPE_ADMIN || ! module_conf('tpl', 'REWRITE_MODE')) {
return false;
Method substr
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function substr($text, $start, $length = null)
{
if ($this->MULTIBYTE == $this->UNICODE_MULTIBYTE) {
return $length === null ? mb_substr($text, $start) : mb_substr($text, $start, $length);
}
Method test_complex
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_complex()
{
$per_page = 10;
conf('per_page', $per_page);
$this->assertEquals($per_page, conf('per_page'));
Similar blocks of code found in 2 locations. Consider refactoring. Open
var _value = ( $scope.action.payout &&
$scope.action.payout.method &&
$scope.action.payout.method.amount &&
$scope.action.payout.method.amount.max
) || 0;
- 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 79.
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 _do_compress_php_file
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _do_compress_php_file($file_to_open = '', $file_to_save = '')
{
$source = file_get_contents($file_to_open);
// Removes comments
foreach ((array) token_get_all($source) as $token) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
var _value = ( $scope.action.payout &&
$scope.action.payout.method &&
$scope.action.payout.method.amount &&
$scope.action.payout.method.amount.min
) || 0;
- 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 79.
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 articles_texts.data.php
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
return [
2 => [
'id' => '2',
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function _get_conf($name, $default = null, array $params = [])
{
if (isset($params[$name]) && $val = $params[$name]) {
return $val;
}
- 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 125.
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
foreach ((array) $values as $key => $cur_value) {
$_what_compare = (string) ($type == 1 ? $cur_value : $key);
$is_selected = $_what_compare == $selected;
$val = ($translate ? t($cur_value) : $cur_value);
$items[] = '<li class="dropdown' . ($is_selected ? ' active' : '') . '"><a data-value="' . $key . '"' . ($is_selected ? ' data-selected="selected"' : '') . '>' . $val . '</a></li>';
- 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 125.
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_conf($name, $default = null, array $params = [])
{
if (isset($params[$name]) && $val = $params[$name]) {
return $val;
}
- 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 125.
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