Showing 3,246 of 4,217 total issues
Function _get_available_widgets_hooks
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
public function _get_available_widgets_hooks($for_section = 'admin')
{
if ( ! in_array($for_section, ['user', 'admin'])) {
$for_section = 'admin';
}
- 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 test_load_fixtures
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
public function test_load_fixtures()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
- 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
File user_stats.sql_php.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
return [
'fields' => [
'user_id' => [
File yf_sphinxsearch.class.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Sphinx search querying.
*/
Method edit
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function edit()
{
$a = $this->_get_info();
if ( ! $a) {
return _404();
Method _tree_items
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _tree_items(&$data, $extra = [])
{
if ($extra['show_controls'] && ! is_callable($extra['show_controls'])) {
$r = [
'edit_link' => isset($extra['edit_link']) ? $extra['edit_link'] : url('/@object/edit_item/%d/@page'),
Method var_edit
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function var_edit()
{
$a = $this->_get_var_info($_GET['id']);
if ( ! $a) {
return _e('Wrong var id');
Method operation
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function operation($options = null)
{
$_ = &$options;
$is_no_count = &$_['no_count'];
$is_sql = &$_['sql'];
Method _get_methods
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _get_methods($params = [])
{
$ONLY_PRIVATE_METHODS = [];
if (isset($params['private'])) {
$ONLY_PRIVATE_METHODS = $params['private'];
Method deposition
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deposition($options)
{
if ( ! $this->ENABLE) {
return null;
}
Method _db_change_if_ok
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _db_change_if_ok($table, $fields, $type, $extra = [])
{
$func = function ($table, $fields, $type, $extra, $form) {
if ( ! $table || ! $type || empty($_POST)) {
return $form;
Method user
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function user($name = '', $extra = [])
{
if (is_array($name)) {
$extra = (array) $extra + $name;
$name = '';
File yf_docs.class.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
class yf_docs
{
private $whats_new = [
Method send
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function send(array $params = [], &$error_message = '')
{
require_php_lib('phpmailer');
$mail = new PHPMailer(true); // defaults to using php 'mail()'
Method go
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function go($sql = '', $url_path = '', $render_type = '', $records_on_page = 0, $num_records = 0, $tpls_path = '', $add_get_vars = 1, $extra = [])
{
if (is_array($url_path)) {
$extra = $url_path;
$url_path = '';
Method test_where_in
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_where_in()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
yf_auth_user
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class yf_auth_user
{
/** @var bool Online users vars */
public $STORE_ONLINE_USERS = false;// Use db table to store online users or not
/** @var int Online TTL if inactive */
yf_db_utils_pgsql
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class yf_db_utils_pgsql extends yf_db_utils_driver
{
public function _get_supported_field_types()
{
// TODO
yf_dynamic
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class yf_dynamic
{
/** @var bool */
public $ERROR_IMAGE_INTERNAL = false;
/** @var bool */
class_db_real_query_builder_mysql_test
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class class_db_real_query_builder_mysql_test extends db_real_abstract
{
public static function _need_skip_test($name)
{
if (defined('HHVM_VERSION') && getenv('TRAVIS') && getenv('CONTINUOUS_INTEGRATION')) {