Showing 4,217 of 4,217 total issues
Identical blocks of code found in 3 locations. Consider refactoring. Open
public function payment($options)
{
if ( ! $this->ENABLE) {
return 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 136.
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 3 locations. Consider refactoring. Open
public function _get_conf($name, $default = null, array $params = [])
{
if (isset($params[$name])) {
return $params[$name];
}
- 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 136.
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 _payout_EcommPay
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _payout_EcommPay($title)
{
$payment_api = _class('payment_api');
$provider_class = $payment_api->provider_class([
'provider_name' => 'ecommpay',
Method repair
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function repair($sql, $db_error, $db)
{
$sql = trim($sql);
// #1191 Can't find FULLTEXT index matching the column list
if (in_array($db_error['code'], [1191]) && $this->RESTORE_FULLTEXT_INDEX) {
Method product_image_search
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function product_image_search()
{
$_GET['id'] = (int) ($_GET['id']);
if ($_GET['id']) {
$product = module('manage_shop')->_product_get_info($_GET['id']);
Method _compile_if_funcs
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _compile_if_funcs(array $m)
{
$cond = trim($m['cond']);
$multiple_cond = 'AND';
if (in_array($cond, ['if_or', 'elseif_or'])) {
Method load_data
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load_data()
{
// Preload db installer SQL CREATE TABLE DDL statements
$ext = '.sql.php';
$pattern = '{,plugins/*/}{,share/}db/sql/*' . $ext;
Method _get_rss_feed_array
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_rss_feed_array($rss_url = '', $feed_ttl = 3600, $num_items = 15)
{
require_php_lib('yf_domit');
// Prepare cache params
Method edit
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
if (is_post() && isset($_POST['mass_delete']) && $_POST['id']) {
$_GET['action'] = 'delete';
return $this->delete();
Method _order_view
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _order_view()
{
if ($_POST['order_id']) {
$_GET['id'] = (int) ($_POST['order_id']);
} else {
Method _show_category_contents
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_category_contents($params = [])
{
$ICONS_PATH = 'uploads/icons/';
$MEDIA_PATH = WEB_PATH;
$force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
Method _skip_by_pattern
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _skip_by_pattern($path = '', $_is_dir = false, $pattern_include = '', $pattern_exclude = '')
{
if ( ! $path) {
return false;
}
Method test_load_fixtures
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_load_fixtures()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function test_31()
{
_class('encryption')->set_cipher('cast256');
$encrypted = _class('encryption')->_safe_encrypt_with_base64(self::$to_encode, self::$secret);
- 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 135.
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 test_21()
{
_class('encryption')->set_cipher('cast128');
$encrypted = _class('encryption')->_safe_encrypt_with_base64(self::$to_encode, self::$secret);
- 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 135.
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 yf_db_driver_mysqli.class.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
load('db_driver', '', 'classes/db/');
class yf_db_driver_mysqli extends yf_db_driver
{
yf_blocks
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_blocks
{
/***/
private $_preload_complete = false;
class_assets_test
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class class_assets_test extends PHPUnit\Framework\TestCase
// class class_assets_test extends yf\tests\wrapper
{
public static function setUpBeforeClass() : void
{
yf_core_install
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_core_install
{
/**
* @param mixed $body
*/
Method tabs
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tabs($tabs = [], $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
$extra_by_id = [];