Showing 5,566 of 7,504 total issues
Function get_allowed_on_site
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function get_allowed_on_site( $blog_id = null ) {
static $allowed_themes = array();
if ( ! $blog_id || ! is_multisite() )
$blog_id = get_current_blog_id();
- 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 discover
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
function discover( $url ) {
$providers = array();
// Fetch URL content
if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) {
- 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 linkFileSelect
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile) {
if (elem.attr('__ngf_gen__')) {
return;
}
function isInputTypeFile() {
Function linkFileSelect
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile) {
if (elem.attr('__ngf_gen__')) {
return;
}
function isInputTypeFile() {
Function showDialog
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showDialog() {
var win, width, height, data;
var generalFormItems = [
{name: 'source1', type: 'filepicker', filetype: 'media', size: 40, autofocus: true, label: 'Source'}
];
Method create
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function create($p_filelist)
{
$v_result=1;
// ----- Reset the error handler
Method wp_insert_user
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wp_insert_user($userdata) {
global $wpdb;
extract($userdata, EXTR_SKIP);
Method __construct
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct( $theme_dir, $theme_root, $_child = null ) {
global $wp_theme_directories;
// Initialize caching on first run.
if ( ! isset( self::$persistently_cache ) ) {
Method _wp_ajax_menu_quick_search
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wp_ajax_menu_quick_search( $request = array() ) {
$args = array();
$type = isset( $request['type'] ) ? $request['type'] : '';
$object_type = isset( $request['object_type'] ) ? $request['object_type'] : '';
$query = isset( $request['q'] ) ? $request['q'] : '';
Method get_items
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_items($start = 0, $end = 0)
{
if (!isset($this->data['items']))
{
if (!empty($this->multifeed_objects))
`` has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
Object.extend(String.prototype, {
gsub: function(pattern, replacement) {
var result = '', source = this, match;
replacement = arguments.callee.prepareReplacement(replacement);
`` has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
Object.extend(String.prototype, {
gsub: function(pattern, replacement) {
var result = '', source = this, match;
replacement = arguments.callee.prepareReplacement(replacement);
WP_Filesystem_FTPext
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WP_Filesystem_FTPext extends WP_Filesystem_Base {
var $link;
var $errors = null;
var $options = array();
Blogger_Import
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Blogger_Import {
// Shows the welcome screen and the magic auth link.
function greet() {
$next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&noheader=true';
Consider simplifying this complex logical expression. Open
Open
if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array( $menu_item->object_id, $possible_object_parents ) ) {
$active_parent_object_ids[] = (int) $menu_item->object_id;
$active_parent_item_ids[] = (int) $menu_item->db_id;
$active_object = $queried_object->post_type;
File Parser.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* SimplePie
*
* A PHP-Based RSS and Atom Feed Framework.
Function fileUpload
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fileUpload() {
var form = $form[0];
var opts = $.extend({}, $.ajaxSettings, options);
var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
Method CopyToAppropriateCommentsSection
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
static $handyatomtranslatorarray = array();
if (empty($handyatomtranslatorarray)) {
$handyatomtranslatorarray['©cpy'] = 'copyright';
$handyatomtranslatorarray['©day'] = 'creation_date'; // iTunes 4.0
Method wp_insert_attachment
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wp_insert_attachment($object, $file = false, $parent = 0) {
global $wpdb, $user_ID;
$defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
Function init
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function() {
if ( lightbox.initialized ) {
return;
}