Showing 3,246 of 4,217 total issues
Method _get_methods
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_methods($params = [])
{
$ONLY_PRIVATE_METHODS = [];
if (isset($params['private'])) {
$ONLY_PRIVATE_METHODS = $params['private'];
Method _render_as_html
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _render_as_html(&$params, &$a, &$to_hide)
{
$body = '';
$header_links = [];
if (MAIN_TYPE_ADMIN && ! $params['no_pages'] && ! $params['no_total'] && $a['total']) {
Method cancel
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cancel($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// var
Method deposition
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deposition($options)
{
if ( ! $this->ENABLE) {
return null;
}
Method add
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add($object_name, $ids = [], $action = null, $extra = [])
{
if ( ! $this->ENABLED) {
return false;
}
Method upload_images
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload_images()
{
$SUPPLIER_ID = $this->SUPPLIER_ID;
$ADMIN_INFO = db()->query_fetch('SELECT * FROM ' . db('sys_admin') . ' WHERE id=' . (int) (main()->ADMIN_ID));
$SUPPLIER_INFO = db()->query_fetch('SELECT * FROM ' . db('shop_suppliers') . ' WHERE id=' . (int) $SUPPLIER_ID);
Method _get_methods
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_methods($params = [])
{
$ONLY_PRIVATE_METHODS = [];
if (isset($params['private'])) {
$ONLY_PRIVATE_METHODS = $params['private'];
yf_module
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_module
{
/** @var bool */
public $USE_CAPTCHA = true;
/** @var bool Force stripslashes on '_format_text' method */
Method go
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function go($new_file_path, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
{
// We do not want to user break our operation
ignore_user_abort(true);
// New name is required
Method ajax_city
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ajax_city()
{
main()->NO_GRAPHICS = true;
// Check input
if (isset($_REQUEST['country'])) {
Method html_out
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function html_out($out_type, $content_type, $str, $params = [])
{
if ( ! $out_type || ! $content_type || ! strlen($str)) {
return false;
}
Method show
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
// TODO: show preview if file is image
// TODO: doubleclick should edit file
// TODO: buttons near eacj table row (edit/show revisions)
Method add
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add($params = [])
{
if (is_string($params)) {
$params = ['table' => $params];
}
Method generate_up
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_up($params = [])
{
if ( ! isset($report)) {
$report = $this->compare($params);
}
Method render_type_slide
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render_type_slide($params = [])
{
$total_records = $params['total_records'];
$per_page = $params['per_page'];
$requested_page = $params['requested_page'];
Method _order_step_finish
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _order_step_finish($FORCE_DISPLAY_FORM = false)
{
module('shop')->_basket_api()->clean();
if (isset($_GET['page'])) {
Function get_asset
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function get_asset($name, $asset_type, $version = '')
{
if ( ! $name) {
return null;
}
- 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 _get_current_lang
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function _get_current_lang($force = false)
{
$langs = $this->LANGUAGES ?: $this->_get_langs();
$FORCE_LOCALE = conf('FORCE_LOCALE');
- 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 dd_table
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function dd_table($replace = [], $field_types = [], $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
if (DEBUG_MODE) {
$ts = microtime(true);
- 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 _combine_content
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function _combine_content(array $out, $out_type, array $to_combine, $combined_file, array $md5_inside_combined)
{
if ( ! file_exists($combined_file)) {
$divider = PHP_EOL;
if ($out_type === 'js') {
- 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"