Showing 3,246 of 4,217 total issues
Function _check_words_length
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
public function _check_words_length($text, $length = 0, $do_encode_email = false)
{
if (empty($length)) {
$length = 60;
if (SITE_MAX_WORD_LENGTH != 'SITE_MAX_WORD_LENGTH' && SITE_MAX_WORD_LENGTH != '') {
- 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 _update_user_geo_location
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _update_user_geo_location($user_id = 0, $FORCE_IP = '')
{
if ( ! main()->USE_GEO_IP) {
return false;
}
Method _add_asset
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _add_asset($_content, $asset_type, $_params = [])
{
if ( ! $_content) {
return false;
}
Method prepare
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepare($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
if (empty($_currency_rate)) {
Method confirmation_code_check
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function confirmation_code_check($options = null)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
// operation
Method api_request
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function api_request($options = null)
{
if ( ! $this->ENABLE) {
return null;
}
Method _user_message
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _user_message($options = null)
{
$url = &$this->url;
// import operation
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
Method edit_item
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function edit_item()
{
// TODO: save file revision to db on each save
if ( ! empty($_GET['id'])) {
$file_name = urldecode($_GET['id']);
Method info
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function info($name, $desc = '', $extra = [], $replace = [])
{
if (is_array($desc)) {
$extra = (array) $extra + $desc;
$desc = '';
Method _correct_protocol
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _correct_protocol($url)
{
if ( ! strlen($url)) {
return false;
}
Method _send_email_safe
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _send_email_safe($email_to, $name_to, $template_name, $data = [], $old_param1 = null, $override = [])
{
$is_test = (defined('TEST_MODE') && TEST_MODE)
&& empty($override['force_send'])
&& empty($this->FORCE_SEND);
Method order_by
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function order_by()
{
$sql = '';
$items = func_get_args();
$count = count((array) $items);
Method delete
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function delete()
{
$i = preg_replace('~[^a-z0-9_]+~ims', '', trim($_GET['i']));
if ( ! $i || ! isset($this->instances[$i])) {
return js_redirect('/@object');
Method test_selects_basic
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function test_selects_basic()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method _payout_PerfectMoney
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _payout_PerfectMoney($title)
{
$payment_api = _class('payment_api');
$provider_class = $payment_api->provider_class([
'provider_name' => 'perfectmoney',
Method api_request
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function api_request($options = null)
{
if ( ! $this->ENABLE) {
return null;
}
Method recreate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function recreate()
{
// var
$payment_api = &$this->payment_api;
$url = &$this->url;
Method _payout_WebMoney
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _payout_WebMoney($title)
{
$payment_api = _class('payment_api');
$provider_class = $payment_api->provider_class([
'provider_name' => 'webmoney',
Method _payout_process
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _payout_process($options = null)
{
if ( ! $this->ENABLE) {
return null;
}
Method _payout_Interkassa
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _payout_Interkassa($title)
{
$payment_api = _class('payment_api');
$provider_class = $payment_api->provider_class([
'provider_name' => 'interkassa',