Showing 3,246 of 4,217 total issues
Function required_any
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function required_any($in, $params = [], $fields = [])
{
$param = trim(is_array($params) ? $params['param'] : $params);
$wildcard = false;
// Example: duration_day,duration_week,duration_month
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
init_yf();
if ( ! defined('PROJECT_PATH') || ! strlen(constant('PROJECT_PATH'))) {
$output->writeln('Error: not inside a project');
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
init_yf();
$params = [];
- 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 process_git
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function process_git() {
$libs_root = $this->libs_root;
$git_urls = $this->git_urls;
foreach ((array)$git_urls as $git_url => $lib_dir) {
$dir = $libs_root. $lib_dir;
- 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 operation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
operation: function( options ) {
var $this = this;
$scope.block_wait = true;
$scope.is_submitted = true;
$scope.status = false;
Method _filter_form_show
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _filter_form_show($filter, $replace)
{
// order
$order_fields = [
'o.operation_id' => 'номер операций',
Method _init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
$payment_api = &$this->payment_api;
$manage_lib = &$this->manage_payment_lib;
$provider_name = &$this->provider_name;
Method _save_csv
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _save_csv($file_name, $data = null)
{
// setlocale( LC_ALL, 'ru_RU.utf8' )
// || setlocale( LC_ALL, 'ru_UA.utf8' )
// || setlocale( LC_ALL, 'en_US.utf8' );
Method _get_daily_data
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_daily_data($days = null)
{
$time = time();
$days = $days ?: 60;
$min_time = $time - $days * 86400;
Method _get_daily_data
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_daily_data($days = null)
{
$time = time();
$days = $days ?: 60;
$min_time = $time - $days * 86400;
Method confirmation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function confirmation(&$options = null, &$data = null, &$operation_data = null)
{
$status = true;
$result = [
'status' => &$status,
Method clone_menu
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function clone_menu()
{
$_GET['id'] = (int) ($_GET['id']);
if (empty($_GET['id'])) {
return _e('No id!');
Method _html_control
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _html_control($name, $values, $extra = [], $replace = [], $func_html_control = '')
{
if ( ! is_array($extra)) {
$extra = [];
}
Method tbl_link
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tbl_link($name, $link, $extra = [], $replace = [], $form)
{
if (is_array($name)) {
$extra = (array) $extra + $name;
$name = $extra['name'];
Method input
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function input($name, $desc = '', $extra = [], $replace = [])
{
if (is_array($desc)) {
$extra = (array) $extra + $desc;
$desc = '';
Method _get_extra_override
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_extra_override($form_id = '')
{
if ( ! strlen($form_id)) {
return [];
}
Method _get_email_text
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_email_text($replace = [], $extra = [])
{
if ($extra['tpl_name']) {
$lang = $extra['locale'] ?: conf('language');
$a = db()->from(self::table_tpls)->where('name', $extra['tpl_name'])->where('locale', $lang)->get();
Method dump
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dump($params = [])
{
$utils = $this->db->utils();
$installer = $this->db->installer();
$db_prefix = $this->db->DB_PREFIX;
Method update_batch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_batch($table, array $data, $index = null, $only_sql = false, $params = [])
{
if ( ! $index) {
$index = $this->get_key_name($table);
}
Method refresh_modules_list
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function refresh_modules_list($silent = false)
{
// Cleanup duplicate records
$q = db()->query('SELECT name, COUNT(*) AS num FROM ' . db('admin_modules') . ' GROUP BY name HAVING num > 1');
while ($a = db()->fetch_assoc($q)) {