Showing 7,504 of 7,504 total issues
Method start_el
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $_wp_nav_menu_max_depth;
$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
ob_start();
Method process_post
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_post($post) {
global $wpdb;
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already
WP_Customize_Widgets
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
final class WP_Customize_Widgets {
/**
* WP_Customize_Manager instance.
*
File deprecated.php
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Deprecated admin functions from past WordPress versions. You shouldn't use these
* functions and look for the alternatives instead. The functions will be removed
* in a later version.
Method _insert_post
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _insert_post( $user, $content_struct ) {
$defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
'post_password' => '', 'post_excerpt' => '', 'post_content' => '', 'post_title' => '' );
$post_data = wp_parse_args( $content_struct, $defaults );
Method privDeleteByRule
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
function privDeleteByRule(&$p_result_list, &$p_options)
{
$v_result=1;
$v_list_detail = array();
Function dispatch
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function dispatch()
{
if (empty ($_GET['step']))
$step = 0;
- 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 network_step2
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function network_step2( $errors = false ) {
global $wpdb;
$hostname = get_clean_basedomain();
$slashed_home = trailingslashit( get_option( 'home' ) );
- 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 _shiftBoundaries
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function _shiftBoundaries($lines, &$changed, $other_changed)
{
$i = 0;
$j = 0;
- 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 wp_load_translations_early
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function wp_load_translations_early() {
global $text_direction, $wp_locale;
static $loaded = false;
if ( $loaded )
- 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 request
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function request( $url, $args = array() ) {
global $wp_version;
$defaults = array(
'method' => 'GET',
- 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 contingentController
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
var contingentController = function ($scope, $http, $q, $location, modalFactory, dataService) {
var url = $location.absUrl();
var lastSlash = url.lastIndexOf('/');
var province = url.slice(lastSlash + 1);
var year = url.slice(lastSlash - 4, lastSlash);
Function QTags
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
var QTags = function(name, id, container, disabled) {
var t = this, cont = document.getElementById(container), i, tag, tb, html, sel;
t.Buttons = [];
t.Links = [];
Identical blocks of code found in 2 locations. Consider refactoring. Open
insertCode : function(code,replaceCursorBefore) {
var range = window.getSelection().getRangeAt(0);
var node = window.document.createTextNode(code);
var selct = window.getSelection();
var range2 = range.cloneRange();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 163.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
insertCode : function(code,replaceCursorBefore) {
var range = window.getSelection().getRangeAt(0);
var node = window.document.createTextNode(code);
var selct = window.getSelection();
var range2 = range.cloneRange();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 163.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File wplink.js
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
var wpLink;
( function( $ ) {
var inputs = {}, rivers = {}, editor, searchTimer, River, Query;
File mce-view.js
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global tinymce, MediaElementPlayer, WPPlaylistView */
/**
* Note: this API is "experimental" meaning that it will probably change
* in the next few releases based on feedback from 3.9.0.
* If you decide to use it, please follow the development closely.
Method get_media_item
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_media_item( $attachment_id, $args = null ) {
global $redir_tab;
if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
$thumb_url = $thumb_url[0];
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
{
foreach ($credits as $credit)
{
$credit_role = null;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 211.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
{
foreach ($credits as $credit)
{
$credit_role = null;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 211.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76