Showing 7,504 of 7,504 total issues
Method wp_get_associated_nav_menu_items
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_type', $taxonomy = '' ) {
$object_id = (int) $object_id;
$menu_item_ids = array();
$query = new WP_Query;
Method get_attachment_icon
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
$id = (int) $id;
if ( !$post = & get_post($id) )
return false;
Method parse_w3cdtf
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse_w3cdtf ( $date_str ) {
# regex to match wc3dtf
$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
Method top
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function top ($msgNum, $numLines = "0") {
// Gets the header and first $numLines of the msg body
// returns data in an array with each returned line being
// an array element. If $numLines is empty, returns
// only the header information, and none of the body.
Method wp_text_diff
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_text_diff( $left_string, $right_string, $args = null ) {
$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
$args = wp_parse_args( $args, $defaults );
if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) )
Method change_encoding
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function change_encoding($data, $input, $output)
{
$input = SimplePie_Misc::encoding($input);
$output = SimplePie_Misc::encoding($output);
Method is_subclass_of
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function is_subclass_of($class1, $class2)
{
if (func_num_args() !== 2)
{
trigger_error('Wrong parameter count for SimplePie_Misc::is_subclass_of()', E_USER_WARNING);
Method get_feed_tags
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_feed_tags($namespace, $tag)
{
$type = $this->get_type();
if ($type & SIMPLEPIE_TYPE_ATOM_10)
{
Method IXR_IntrospectionServer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function IXR_IntrospectionServer() {
$this->setCallbacks();
$this->setCapabilities();
$this->capabilities['introspection'] = array(
'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html',
Method date_i18n
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
global $wp_locale;
$i = $unixtimestamp;
// Sanity check for PHP 5.1.0-
if ( false === $i || intval($i) < 0 ) {
Method get_date_permastruct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_date_permastruct() {
if (isset($this->date_structure)) {
return $this->date_structure;
}
Method wp_maintenance
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_maintenance() {
if ( !file_exists( ABSPATH . '.maintenance' ) || defined( 'WP_INSTALLING' ) )
return;
global $upgrading;
Method get_site_option
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_site_option( $option, $default = false, $use_cache = true ) {
global $wpdb;
/**
* Filter an existing site option before it is retrieved.
Method add_site_option
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_site_option( $option, $value ) {
global $wpdb;
wp_protect_special_option( $option );
Method CanCreateParticipant
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public void CanCreateParticipant()
{
Test(
Given(),
Method Handle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public IEnumerable Handle(Func<Guid, ParticipantAggregate> al, UpdateParticipantProfile command)
{
var agg = al(command.Id);
yield return new ParticipantProfileChanged
Method get_output_format
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_output_format( $filename = null, $mime_type = null ) {
$new_ext = $file_ext = null;
$file_mime = null;
// By default, assume specified type takes priority
Similar blocks of code found in 4 locations. Consider refactoring. Open
editButton = DOM.add('wp_editbtns', 'img', {
src : t.url+'/img/image.png',
id : 'wp_editimgbtn',
width : '24',
height : '24',
- 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 59.
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
Similar blocks of code found in 4 locations. Consider refactoring. Open
dellButton = DOM.add('wp_editbtns', 'img', {
src : t.url+'/img/delete.png',
id : 'wp_delimgbtn',
width : '24',
height : '24',
- 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 59.
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
function $w(string) {
if (!Object.isString(string)) return [];
string = string.strip();
return string ? string.split(/\s+/) : [];
}
- 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 59.
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