lesterchan/wp-sweep

View on GitHub

Showing 37 of 316 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'duplicated_commentmeta':
                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, comment_id, COUNT(*) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
Severity: Major
Found in wp-sweep.php and 3 other locations - About 5 hrs to fix
wp-sweep.php on lines 734..746
wp-sweep.php on lines 760..772
wp-sweep.php on lines 773..785

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 161.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'duplicated_postmeta':
                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, post_id, COUNT(*) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
Severity: Major
Found in wp-sweep.php and 3 other locations - About 5 hrs to fix
wp-sweep.php on lines 747..759
wp-sweep.php on lines 760..772
wp-sweep.php on lines 773..785

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 161.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'duplicated_termmeta':
                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, term_id, COUNT(*) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
Severity: Major
Found in wp-sweep.php and 3 other locations - About 5 hrs to fix
wp-sweep.php on lines 734..746
wp-sweep.php on lines 747..759
wp-sweep.php on lines 760..772

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 161.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'duplicated_usermeta':
                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(umeta_id ORDER BY umeta_id DESC) AS ids, user_id, COUNT(*) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
Severity: Major
Found in wp-sweep.php and 3 other locations - About 5 hrs to fix
wp-sweep.php on lines 734..746
wp-sweep.php on lines 747..759
wp-sweep.php on lines 773..785

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 161.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'orphan_usermeta':
                $query = $wpdb->get_results( "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $user_id = (int) $meta->user_id;
Severity: Major
Found in wp-sweep.php and 3 other locations - About 4 hrs to fix
wp-sweep.php on lines 635..650
wp-sweep.php on lines 651..666
wp-sweep.php on lines 683..698

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 137.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'orphan_commentmeta':
                $query = $wpdb->get_results( "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $comment_id = (int) $meta->comment_id;
Severity: Major
Found in wp-sweep.php and 3 other locations - About 4 hrs to fix
wp-sweep.php on lines 635..650
wp-sweep.php on lines 667..682
wp-sweep.php on lines 683..698

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 137.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'orphan_termmeta':
                $query = $wpdb->get_results( "SELECT term_id, meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $term_id = (int) $meta->term_id;
Severity: Major
Found in wp-sweep.php and 3 other locations - About 4 hrs to fix
wp-sweep.php on lines 635..650
wp-sweep.php on lines 651..666
wp-sweep.php on lines 667..682

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 137.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            case 'orphan_postmeta':
                $query = $wpdb->get_results( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
                if ( $query ) {
                    foreach ( $query as $meta ) {
                        $post_id = (int) $meta->post_id;
Severity: Major
Found in wp-sweep.php and 3 other locations - About 4 hrs to fix
wp-sweep.php on lines 651..666
wp-sweep.php on lines 667..682
wp-sweep.php on lines 683..698

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 137.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case 'unapproved_comments':
                $query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
                if ( $query ) {
                    foreach ( $query as $id ) {
                        wp_delete_comment( (int) $id, true );
Severity: Major
Found in wp-sweep.php and 2 other locations - About 1 hr to fix
wp-sweep.php on lines 565..575
wp-sweep.php on lines 598..608

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 97.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case 'auto_drafts':
                $query = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
                if ( $query ) {
                    foreach ( $query as $id ) {
                        wp_delete_post( (int) $id, true );
Severity: Major
Found in wp-sweep.php and 2 other locations - About 1 hr to fix
wp-sweep.php on lines 587..597
wp-sweep.php on lines 598..608

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 97.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case 'spam_comments':
                $query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
                if ( $query ) {
                    foreach ( $query as $id ) {
                        wp_delete_comment( (int) $id, true );
Severity: Major
Found in wp-sweep.php and 2 other locations - About 1 hr to fix
wp-sweep.php on lines 565..575
wp-sweep.php on lines 587..597

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 97.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $revisions ) ) : ?>
                        <button data-action="sweep" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_revisions' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_revisions' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $total_tables ) ) : ?>
                        <button data-action="sweep" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_optimize_database' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_optimize_database' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $orphan_commentmeta ) ) : ?>
                        <button data-action="sweep" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_orphan_commentmeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_orphan_commentmeta' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $deleted_posts ) ) : ?>
                        <button data-action="sweep" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_deleted_posts' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_deleted_posts' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $unapproved_comments ) ) : ?>
                        <button data-action="sweep" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_unapproved_comments' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_unapproved_comments' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $orphan_postmeta ) ) : ?>
                        <button data-action="sweep" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_orphan_postmeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_orphan_postmeta' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $orphan_usermeta ) ) : ?>
                        <button data-action="sweep" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_orphan_usermeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_orphan_usermeta' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                <?php if ( ! empty( $duplicated_termmeta ) ) : ?>
                    <button data-action="sweep" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_duplicated_termmeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                    <button data-action="sweep_details" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_duplicated_termmeta' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                <?php else : ?>
                    <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 525..530
admin.php on lines 563..568

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 86.

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

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

                    <?php if ( ! empty( $transient_options ) ) : ?>
                        <button data-action="sweep" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_transient_options' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_transient_options' ) ); ?>" class="button btn-sweep-details"><?php esc_html_e( 'Details', 'wp-sweep' ); ?></button>
                    <?php else : ?>
                        <?php esc_html_e( 'N/A', 'wp-sweep' ); ?>
Severity: Major
Found in admin.php and 18 other locations - About 1 hr to fix
admin.php on lines 112..117
admin.php on lines 132..137
admin.php on lines 152..157
admin.php on lines 172..177
admin.php on lines 192..197
admin.php on lines 212..217
admin.php on lines 250..255
admin.php on lines 270..275
admin.php on lines 290..295
admin.php on lines 310..315
admin.php on lines 330..335
admin.php on lines 368..373
admin.php on lines 388..393
admin.php on lines 426..431
admin.php on lines 446..451
admin.php on lines 466..471
admin.php on lines 487..492
admin.php on lines 563..568

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 86.

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

Further Reading

Severity
Category
Status
Source
Language