Showing 4,217 of 4,217 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function price($name, $desc = '', $extra = [], $replace = [])
{
if (is_array($desc)) {
$extra = (array) $extra + $desc;
$desc = '';
- 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 119.
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 decimal($name, $desc = '', $extra = [], $replace = [])
{
if (is_array($desc)) {
$extra = (array) $extra + $desc;
$desc = '';
- 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 119.
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
function _basic_auth_check($users = [])
{
$auth_user = trim($_SERVER['PHP_AUTH_USER']);
$auth_pswd = trim($_SERVER['PHP_AUTH_PW']);
if ( ! strlen($auth_user) || ! strlen($auth_pswd)) {
- 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 119.
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
function _debug_auth_check($users = [])
{
$auth_user = trim($_SERVER['PHP_AUTH_USER']);
$auth_pswd = trim($_SERVER['PHP_AUTH_PW']);
if ( ! strlen($auth_user) || ! strlen($auth_pswd)) {
- 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 119.
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 a
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function a()
{
$args = func_get_args();
$a = [];
// numerics params
Method load__cashex_xml
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load__cashex_xml($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// var
Method _form_options
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _form_options($options)
{
if ( ! $this->ENABLE) {
return null;
}
Method _api_response
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _api_response()
{
if ( ! $this->ENABLE) {
return null;
}
Method active
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function active($params = [])
{
if (is_string($params)) {
$params = [
'table' => $params,
Method _check_payout_operation
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _check_payout_operation($operation_id)
{
$payment_api = &$this->payment_api;
$operation = $payment_api->operation(['operation_id' => $operation_id]);
$address = $operation['options']['request'][0]['options']['address'] ?: false;
Method _save_login_in_session
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _save_login_in_session($user_info = [], $no_redirect_on_success = false)
{
if (empty($user_info['id'])) {
return js_redirect($this->URL_WRONG_LOGIN);
} elseif ($this->_is_user_inactive($user_info)) {
Method save
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save(array $params = [])
{
// Try to get user error message source
$backtrace = debug_backtrace();
$cur_trace = $backtrace[2];
Method create_trigger
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_trigger($name, $table, $trigger_time, $trigger_event, $trigger_body, $extra = [], &$error = false)
{
if (strpos($name, '.') !== false) {
list($db_name, $name) = explode('.', trim($name));
}
Method multi_get
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function multi_get($names = [], $force_ttl = 0, $params = [])
{
$do_real_work = true;
if ( ! $this->_driver_ok || $this->NO_CACHE) {
$do_real_work = false;
Method footer_link
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function footer_link($name, $link, $extra = [])
{
$item = [
'type' => __FUNCTION__,
'name' => $name,
Method query_fetch_all
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function query_fetch_all($sql, $key_name = null, $use_cache = true)
{
if ( ! strlen($sql)) {
return false;
}
Method manufacturer_add
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function manufacturer_add()
{
if (main()->is_post()) {
if ( ! $_POST['name']) {
_re('Product name must be filled');
Method _init
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
$supplier = db()->get('SELECT supplier_id, main_cat_id FROM ' . db('shop_admin_to_supplier') . ' WHERE admin_id=' . (int) (main()->ADMIN_ID));
if ($supplier['supplier_id']) {
$this->SUPPLIER_ID = $supplier['supplier_id'];
Method log_error
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function log_error($params = [])
{
if ( ! $this->LOG_ERRORS) {
return false;
}
Method test_select_complex
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_select_complex()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}