Showing 5,566 of 7,504 total issues
Method wp_list_pages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wp_list_pages($args = '') {
$defaults = array(
'depth' => 0, 'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0, 'exclude' => '',
Method image_get_intermediate_size
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function image_get_intermediate_size($post_id, $size='thumbnail') {
if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
return false;
// get the best one for a specified set of dimensions
Method _compareseq
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _compareseq ($xoff, $xlim, $yoff, $ylim)
{
/* Slide down the bottom initial diagonal. */
while ($xoff < $xlim && $yoff < $ylim
&& $this->xv[$xoff] == $this->yv[$yoff]) {
Method get_title
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_title()
{
if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
{
return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
Method get_language
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_language()
{
if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
Method get_title
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_title()
{
if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
{
return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
Method get_image_tags
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_image_tags($namespace, $tag)
{
$type = $this->get_type();
if ($type & SIMPLEPIE_TYPE_RSS_10)
{
Method is_email
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function is_email( $email, $check_dns = false ) {
// Test for the minimum length the email can be
if ( strlen( $email ) < 3 ) {
return apply_filters( 'is_email', false, $email, 'email_too_short' );
}
Method wpmu_signup_blog_notification
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) {
/**
* Filter whether to bypass the new site email notification.
*
* @since MU
Method wpmu_create_blog
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
$defaults = array( 'public' => 0 );
$meta = wp_parse_args( $meta, $defaults );
$domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
Method discover
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function discover( $url ) {
$providers = array();
// Fetch URL content
if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) {
Method _wp_timezone_choice_usort_callback
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wp_timezone_choice_usort_callback( $a, $b ) {
// Don't use translated versions of Etc
if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) {
// Make the order of these more like the old dropdown
if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) {
Method do_action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function do_action($tag, $arg = '') {
global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
if ( is_array($wp_actions) )
$wp_actions[] = $tag;
Method Send
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Send() {
$header = '';
$body = '';
$result = true;
Method ScanAssembly
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void ScanAssembly(Assembly ass)
{
// Scan for and register handlers.
var handlers =
from t in ass.GetTypes()
Function renderImageToCanvas
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
canvas,
img,
sourceX,
sourceY,
sourceWidth,
Function renderImageToCanvas
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
api.renderImageToCanvas = function (canvas, img, sx, sy, sw, sh, dx, dy, dw, dh){
Function updateModel
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function updateModel($parse, $timeout, scope, ngModel, attr, fileChange, files, rejFiles, evt, noDelay) {
Function updateModel
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function updateModel($parse, $timeout, scope, ngModel, attr, fileChange, files, rejFiles, evt, noDelay) {
Function setOpacity
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
Element.Methods.setOpacity = function(element, value) {
function stripAlpha(filter){
return filter.replace(/alpha\([^\)]*\)/gi,'');
}
element = $(element);
- 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"