Showing 7,504 of 7,504 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
static $lookup = array (
0 => 'Other',
1 => '32x32 pixels \'file icon\' (PNG only)',
2 => 'Other file icon',
3 => 'Cover (front)',
- 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 ) )
return apply_filters( 'embed_handler_html', $return, $url, $attr );
- 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
static $APICPictureTypeLookup = array(
0x00 => 'Other',
0x01 => '32x32 pixels \'file icon\' (PNG only)',
0x02 => 'Other file icon',
0x03 => 'Cover (front)',
- 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
Function _apply
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_apply: function (file, fn){
api.log('FlashAPI.Image._apply:', file);
if( _isHtmlFile(file) ){
this.parent.apply(this, arguments);
Function _call
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_call: function( type, url, params, callback ) {
url = 'https://picasaweb.google.com/data/feed/api/' + url + '?';
if (typeof params == 'function') {
Function open
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.open = function( args, params ) {
var $element,
self = this,
wp = this.wp;
Function getAttrib
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
getAttrib : function(e, at) {
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
if (ed.settings.inline_styles) {
switch (at) {
Function _call
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_call: function( type, url, params, callback ) {
url = 'https://picasaweb.google.com/data/feed/api/' + url + '?';
if (typeof params == 'function') {
Function createToolbar
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
createToolbar: function() {
var filters, FiltersConstructor;
/**
* @member {wp.media.view.Toolbar}
Method get_sample_permalink_html
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
$post = &get_post($id);
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
if ( 'publish' == $post->post_status ) {
Method wp_dashboard
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_dashboard() {
global $screen_layout_columns;
$hide2 = $hide3 = $hide4 = '';
switch ( $screen_layout_columns ) {
Method send_confirmation_on_profile_email
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function send_confirmation_on_profile_email() {
global $errors, $wpdb;
$current_user = wp_get_current_user();
if ( ! is_object($errors) )
$errors = new WP_Error();
Method wp_generate_attachment_metadata
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_generate_attachment_metadata( $attachment_id, $file ) {
$attachment = get_post( $attachment_id );
$metadata = array();
if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
Method wp_ajax_add_tag
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_ajax_add_tag() {
global $wp_list_table;
check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
Method greet
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function greet() {
$this->header();
?>
<p><?php _e('This is a basic GreyMatter to WordPress import script.') ?></p>
<p><?php _e('What it does:') ?></p>
Method step2
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function step2() {
set_time_limit( 0 );
update_option( 'ljapi_step', 2 );
$this->username = get_option( 'ljapi_username' );
$this->password = get_option( 'ljapi_password' );
Method signup_another_blog
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
$current_user = wp_get_current_user();
if ( ! is_wp_error($errors) ) {
$errors = new WP_Error();
Method wp_getUsers
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_getUsers( $args ) {
if ( ! $this->minimum_args( $args, 3 ) )
return $this->error;
$this->escape( $args );
Method wp_getTerms
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_getTerms( $args ) {
if ( ! $this->minimum_args( $args, 4 ) )
return $this->error;
$this->escape( $args );
Method query
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function query() {
$args = func_get_args();
$method = array_shift($args);
$request = new IXR_Request($method, $args);
$xml = $request->getXml();