Showing 4,217 of 4,217 total issues
File yf_manage_notifications.class.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class yf_manage_notifications
{
public $RECEIVER_TYPES = [
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function exists($in, $params = [])
{
if ( ! $in) {
return false;
}
- 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 175.
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 is_unique($in, $params = [])
{
if ( ! $in) {
return true;
}
- 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 175.
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 view
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function view()
{
// check operation
$operation = $this->_operation();
// import options
Function multi_check_box
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
{
if (is_array($name)) {
$extra = (array) $extra + $name;
$name = $extra['name'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _do_login
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _do_login()
{
$AUTH_LOGIN = trim($_POST[$this->LOGIN_FIELD]);
$AUTH_PSWD = trim($_POST[$this->PSWD_FIELD]);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _render_add_custom_fields
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _render_add_custom_fields(&$params, &$data, &$ids)
{
if ( ! $data || ! $ids || ! $params['custom_fields']) {
return false;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _currency_convert
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _currency_convert($number = 0, $c_from = '', $c_to = '')
{
if ( ! $number || ! $c_from || ! $c_to) {
return $number;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _store_item
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _store_item($data = [])
{
if (is_string($data) && strlen($data)) {
$data = ['url' => $data];
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method show
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Method _show_for_object_tree
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_for_object_tree($params = [])
{
$OBJECT_NAME = ! empty($params['object_name']) ? $params['object_name'] : $_GET['object'];
$OBJECT_ID = ! empty($params['object_id']) ? (int) ($params['object_id']) : (int) ($_GET['id']);
$STPL_NAME_MAIN = ! empty($params['stpl_main']) ? $params['stpl_main'] : 'comments/main_tree';
Method conf
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function conf($name = null, $new_value = null, $_arr_name = '')
{
$_arr_sub = null;
if ( ! $_arr_name) {
$_arr_name = 'CONF';
yf_db_migrator
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class yf_db_migrator
{
/**
* Catch missing method call.
* @param mixed $name
Method _show_menu
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_menu($input = [])
{
$RETURN_ARRAY = isset($input['return_array']) ? $input['return_array'] : false;
$force_stpl_name = isset($input['force_stpl_name']) ? $input['force_stpl_name'] : false;
$menu_name = $input['name'];
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach ((array) json_decode((string) $_POST['items'], $assoc = true) as $order_id => $info) {
$item_id = (int) $info['item_id'];
if ( ! $item_id || ! isset($items[$item_id])) {
continue;
}
- 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 172.
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) json_decode((string) $_POST['items'], $assoc = true) as $order_id => $info) {
$item_id = (int) $info['item_id'];
if ( ! $item_id || ! isset($items[$item_id])) {
continue;
}
- 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 172.
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_utf8.class.php
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Unicode methods.
*
Method _recreate
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _recreate($options = null)
{
// import operation
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// var
Method compact_info
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compact_info()
{
main()->NO_GRAPHICS = true;
conf('no_ajax_here', true);
// Check user id
Function multi_select
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
{
// Passing params as array
if (is_array($name)) {
$extra = (array) $extra + $name;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"