Showing 7,504 of 7,504 total issues
Method inline_edit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inline_edit() {
$tax = get_taxonomy( $this->screen->taxonomy );
if ( ! current_user_can( $tax->cap->edit_terms ) )
return;
Method make_site_theme_from_default
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function make_site_theme_from_default($theme_name, $template) {
$site_dir = WP_CONTENT_DIR . "/themes/$template";
$default_dir = WP_CONTENT_DIR . '/themes/default';
// Copy files from the default theme to the site theme.
Method link_submit_meta_box
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link_submit_meta_box($link) {
?>
<div class="submitbox" id="submitlink">
<div id="minor-publishing">
Method wp_getComment
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_getComment($args) {
$this->escape($args);
$blog_id = (int) $args[0];
$username = $args[1];
Method wp_editComment
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_editComment($args) {
$this->escape($args);
$blog_id = (int) $args[0];
$username = $args[1];
Method wp_newTerm
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_newTerm( $args ) {
if ( ! $this->minimum_args( $args, 4 ) )
return $this->error;
$this->escape( $args );
Method ParseOggPageHeader
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ParseOggPageHeader() {
// http://xiph.org/ogg/vorbis/doc/framing.html
$oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
$filedata = $this->fread($this->getid3->fread_buffer_size());
Method readData
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData() {
$value = null;
$type = $this->stream->readByte();
switch ($type) {
Method CalculateCompressionRatioVideo
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function CalculateCompressionRatioVideo() {
if (empty($this->info['video'])) {
return false;
}
if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) {
Method wp_admin_bar_new_content_menu
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
$actions = array();
$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
Method image_resize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {
$image = wp_load_image( $file );
if ( !is_resource( $image ) )
return new WP_Error('error_loading_image', $image);
Method wp_upload_dir
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_upload_dir( $time = null ) {
$siteurl = get_option( 'siteurl' );
$upload_path = get_option( 'upload_path' );
$upload_path = trim($upload_path);
if ( empty($upload_path) ) {
Method sanitize_user_field
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sanitize_user_field($field, $value, $user_id, $context) {
$int_fields = array('ID');
if ( in_array($field, $int_fields) )
$value = (int) $value;
Method convert_chars
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convert_chars($content, $deprecated = '') {
// Translation of invalid Unicode references range to valid range
$wp_htmltranswinuni = array(
'€' => '€', // the Euro sign
'' => '',
Method _wp_upgrade_revisions_of_post
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _wp_upgrade_revisions_of_post( $post, $revisions ) {
global $wpdb;
// Add post option exclusively
$lock = "revision-upgrade-{$post->ID}";
Method GetGuestPackages
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public List<GuestPackage> GetGuestPackages(string year)
{
var tournament = Tournaments.Single(x => x.Year == year);
var guestPackages = GuestPackages.Where(x => x.TournamentId == tournament.Id).ToList();
Method Then
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected Action<object> Then(params object[] expectedEvents)
{
return got =>
{
var gotEvents = got as object[];
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'multiple':
if ( $category->parent )
$thelist .= get_category_parents( $category->parent, true, $separator );
$thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
break;
- 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 113.
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
foreach ( $this->handlers as $priority => $handlers ) {
foreach ( $handlers as $id => $handler ) {
if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
/**
- 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 113.
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 2 locations. Consider refactoring. Open
case 'multiple':
if ( $category->parent )
$thelist .= get_category_parents( $category->parent, true, $separator );
$thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->cat_name.'</a>';
break;
- 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 113.
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