Showing 3,246 of 4,217 total issues
Function yf_placeholder_img
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function yf_placeholder_img($w = 100, $h = 100, $params = [])
{
$w = abs((int) $w ?: 100);
$h = abs((int) $h ?: 100);
$text = $params['text'] ?: $w . ' x ' . $h;
- 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_filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _show_filter()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Method _show_filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _show_filter()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Function _timer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$this._timer = $timeout( function() {
var result = PaymentApi.operation( options );
result.$promise.then(
function( r ) {
$scope.block_wait = false;
Method cache_fill
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function cache_fill()
{
$this->cache_purge();
// TODO: use temp dir while caching
// TODO: verify that all files are available
Method thumbnails
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function thumbnails($data = [], $extra = [])
{
$items = [];
$columns = (int) $extra['columns'] ?: 3;
$row_class = 'span' . round(12 / $columns) . ' col-md-' . round(12 / $columns);
Method _show_filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _show_filter()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Method import
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function import()
{
$a['back_link'] = url('/@object/vars');
$a['redirect_link'] = $a['back_link'];
! $a['lang'] && $a['lang'] = 'en';
Method image_select_box
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function image_select_box($name, $values = [], $selected = '', $extra = [])
{
if (is_array($name)) {
$extra = (array) $extra + $name;
} else {
Method set_content
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function set_content($asset_type, $md5, $content_type, $content, $params = [])
{
if (isset($this->content[$asset_type][$md5])) {
return $this->content[$asset_type][$md5];
}
Method files
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function files()
{
$self_page_css = 'body.get-object-' . $_GET['object'];
css('
' . $self_page_css . ' li.li-header { list-style: none; display:none; }
Method user_var_edit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function user_var_edit()
{
$_GET['id'] = (int) ($_GET['id']);
$A = db()->query_fetch('SELECT * FROM ' . db('locale_user_tr') . ' WHERE id=' . (int) ($_GET['id']));
if ( ! $A) {
Method _update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _update()
{
$currency__api = _class('payment_api__currency');
$result = true;
$total = 0;
Method _check_all_interkassa
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _check_all_interkassa()
{
// var
$html = _class('html');
$payment_api = &$this->payment_api;
Method type
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function type($options = null)
{
// get type
$type = $this->type;
$type_index = $this->type_index;
Method _show_filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _show_filter()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Method get_account__by_id
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get_account__by_id($options = null)
{
$account = &$this->account;
$account_id = $this->account_id;
// cache
Method _show_filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _show_filter()
{
$object = &$this->object;
$action = &$this->action;
$filter_name = &$this->filter_name;
Method _cancel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _cancel($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// var
Method fire
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fire($event, $payload = [], $halt = false)
{
if (DEBUG_MODE) {
debug('events_' . __FUNCTION__ . '[]', [
'name' => $event,