lesterchan/wp-sweep

View on GitHub

Showing 34 of 326 total issues

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

                    <?php if ( ! empty( $duplicated_usermeta ) ) : ?>
                        <button data-action="sweep" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_duplicated_usermeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_duplicated_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 35 mins 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 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 92.

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_comments ) ) : ?>
                        <button data-action="sweep" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_deleted_comments' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_deleted_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 35 mins 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 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 92.

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 35 mins 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 92.

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( $oembed_postmeta ) ) : ?>
                        <button data-action="sweep" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_oembed_postmeta' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_oembed_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 35 mins 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 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 92.

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 35 mins 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 92.

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 35 mins 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 92.

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( $spam_comments ) ) : ?>
                        <button data-action="sweep" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_spam_comments' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_spam_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 35 mins 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 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 92.

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( $unused_terms ) ) : ?>
                        <button data-action="sweep" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_unused_terms' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_unused_terms' ) ); ?>" 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 35 mins 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 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 92.

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 35 mins 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 92.

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 35 mins 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 92.

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 35 mins 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 92.

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_term_relationships ) ) : ?>
                        <button data-action="sweep" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_orphan_term_relationships' ) ); ?>" class="button button-primary btn-sweep"><?php esc_html_e( 'Sweep', 'wp-sweep' ); ?></button>
                        <button data-action="sweep_details" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wp_sweep_details_orphan_term_relationships' ) ); ?>" 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 35 mins 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 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 92.

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 2 locations. Consider refactoring.
Open

    public function plugin_deactivation( $network_wide ) {
        if ( is_multisite() && $network_wide ) {
            $ms_sites = (array) get_sites();

            if ( 0 < count( $ms_sites ) ) {
Severity: Minor
Found in inc/class-wpsweep.php and 1 other location - About 30 mins to fix
inc/class-wpsweep.php on lines 865..879

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

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 2 locations. Consider refactoring.
Open

    public function plugin_activation( $network_wide ) {
        if ( is_multisite() && $network_wide ) {
            $ms_sites = (array) get_sites();

            if ( 0 < count( $ms_sites ) ) {
Severity: Minor
Found in inc/class-wpsweep.php and 1 other location - About 30 mins to fix
inc/class-wpsweep.php on lines 901..915

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

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