felixarntz/post-types-definitely

View on GitHub

Showing 37 of 187 total issues

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

        private static function get_labels_neuter( $plural_name, $singular_name ) {
            return array(
                'name'                  => $plural_name,
                'singular_name'         => $singular_name,
                'menu_name'             => $plural_name,
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 3 days to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 61..93
inc/WPPTD/PostTypeLabelGenerator.php on lines 103..135

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

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

        private static function get_labels_masculine( $plural_name, $singular_name ) {
            return array(
                'name'                  => $plural_name,
                'singular_name'         => $singular_name,
                'menu_name'             => $plural_name,
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 3 days to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 103..135
inc/WPPTD/PostTypeLabelGenerator.php on lines 145..177

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

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

        private static function get_labels_feminine( $plural_name, $singular_name ) {
            return array(
                'name'                  => $plural_name,
                'singular_name'         => $singular_name,
                'menu_name'             => $plural_name,
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 3 days to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 61..93
inc/WPPTD/PostTypeLabelGenerator.php on lines 145..177

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

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

        private static function get_labels_masculine( $plural_name, $singular_name ) {
            return array(
                'name'                            => $plural_name,
                'singular_name'                    => $singular_name,
                'menu_name'                        => $plural_name,
Severity: Major
Found in inc/WPPTD/TaxonomyLabelGenerator.php and 2 other locations - About 2 days to fix
inc/WPPTD/TaxonomyLabelGenerator.php on lines 97..123
inc/WPPTD/TaxonomyLabelGenerator.php on lines 133..159

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

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

        private static function get_labels_neuter( $plural_name, $singular_name ) {
            return array(
                'name'                            => $plural_name,
                'singular_name'                    => $singular_name,
                'menu_name'                        => $plural_name,
Severity: Major
Found in inc/WPPTD/TaxonomyLabelGenerator.php and 2 other locations - About 2 days to fix
inc/WPPTD/TaxonomyLabelGenerator.php on lines 61..87
inc/WPPTD/TaxonomyLabelGenerator.php on lines 97..123

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

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

        private static function get_labels_feminine( $plural_name, $singular_name ) {
            return array(
                'name'                            => $plural_name,
                'singular_name'                    => $singular_name,
                'menu_name'                        => $plural_name,
Severity: Major
Found in inc/WPPTD/TaxonomyLabelGenerator.php and 2 other locations - About 2 days to fix
inc/WPPTD/TaxonomyLabelGenerator.php on lines 61..87
inc/WPPTD/TaxonomyLabelGenerator.php on lines 133..159

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

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

        private static function get_bulk_messages_feminine( $plural_name, $singular_name ) {
            return array(
                'updated'    => array(
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the singular post type label (feminine)', 'post-types-definitely' ), $singular_name ),
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the plural post type label (feminine)', 'post-types-definitely' ), $plural_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 259..282
inc/WPPTD/PostTypeLabelGenerator.php on lines 325..348

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

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

        private static function get_bulk_messages_masculine( $plural_name, $singular_name ) {
            return array(
                'updated'    => array(
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the singular post type label (masculine)', 'post-types-definitely' ), $singular_name ),
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the plural post type label (masculine)', 'post-types-definitely' ), $plural_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 292..315
inc/WPPTD/PostTypeLabelGenerator.php on lines 325..348

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

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

        private static function get_bulk_messages_neuter( $plural_name, $singular_name ) {
            return array(
                'updated'    => array(
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the singular post type label (neuter)', 'post-types-definitely' ), $singular_name ),
                    sprintf( _x( '%%s %s updated.', 'bulk post message: first argument is a number, second is the plural post type label (neuter)', 'post-types-definitely' ), $plural_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 259..282
inc/WPPTD/PostTypeLabelGenerator.php on lines 292..315

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

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

        private static function get_messages_feminine( $plural_name, $singular_name ) {
            return array(
                 0 => '',
                 1 => sprintf( _x( '%1$s updated. <a href="%%s">View %1$s</a>', 'post message: argument is the singular post type label (feminine)', 'post-types-definitely' ), $singular_name ),
                 2 => sprintf( _x( 'Custom %s field updated.', 'post message: argument is the singular post type label (feminine)', 'post-types-definitely' ), $singular_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 187..201
inc/WPPTD/PostTypeLabelGenerator.php on lines 235..249

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

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

        private static function get_messages_neuter( $plural_name, $singular_name ) {
            return array(
                 0 => '',
                 1 => sprintf( _x( '%1$s updated. <a href="%%s">View %1$s</a>', 'post message: argument is the singular post type label (neuter)', 'post-types-definitely' ), $singular_name ),
                 2 => sprintf( _x( 'Custom %s field updated.', 'post message: argument is the singular post type label (neuter)', 'post-types-definitely' ), $singular_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 187..201
inc/WPPTD/PostTypeLabelGenerator.php on lines 211..225

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

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

        private static function get_messages_masculine( $plural_name, $singular_name ) {
            return array(
                 0 => '',
                 1 => sprintf( _x( '%1$s updated. <a href="%%s">View %1$s</a>', 'post message: argument is the singular post type label (masculine)', 'post-types-definitely' ), $singular_name ),
                 2 => sprintf( _x( 'Custom %s field updated.', 'post message: argument is the singular post type label (masculine)', 'post-types-definitely' ), $singular_name ),
Severity: Major
Found in inc/WPPTD/PostTypeLabelGenerator.php and 2 other locations - About 1 day to fix
inc/WPPTD/PostTypeLabelGenerator.php on lines 211..225
inc/WPPTD/PostTypeLabelGenerator.php on lines 235..249

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

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 register( $parent_metabox = null, $parent_taxonomy = null ) {
            // Do not register meta at this point, unless it is specifically enabled for the REST API.
            if ( ! $this->args['show_in_rest'] ) {
                return;
            }
Severity: Major
Found in inc/WPPTD/Components/TermField.php and 1 other location - About 7 hrs to fix
inc/WPPTD/Components/Field.php on lines 83..115

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

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 register( $parent_metabox = null, $parent_post_type = null ) {
            // Do not register meta at this point, unless it is specifically enabled for the REST API.
            if ( ! $this->args['show_in_rest'] ) {
                return;
            }
Severity: Major
Found in inc/WPPTD/Components/Field.php and 1 other location - About 7 hrs to fix
inc/WPPTD/Components/TermField.php on lines 54..86

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        public static function validate_args( $args ) {
            // handle row actions
            if ( ! $args['show_ui'] || ! is_array( $args['row_actions'] ) ) {
                $args['row_actions'] = array();
            }
Severity: Major
Found in inc/WPPTD/PostTypeActionHandler.php and 1 other location - About 6 hrs to fix
inc/WPPTD/TaxonomyActionHandler.php on lines 290..320

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        public static function validate_args( $args ) {
            // handle row actions
            if ( ! $args['show_ui'] || ! is_array( $args['row_actions'] ) ) {
                $args['row_actions'] = array();
            }
Severity: Major
Found in inc/WPPTD/TaxonomyActionHandler.php and 1 other location - About 6 hrs to fix
inc/WPPTD/PostTypeActionHandler.php on lines 306..336

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if ( ! call_user_func_array( 'current_user_can', $this->get_bulk_capability_args() ) ) {
                $action_message = sprintf( __( 'The %s were not updated because of missing privileges.', 'post-types-definitely' ), $component_plural_name );
                $error = true;
            } elseif ( empty( $bulk_actions[ $bulk_action ]['callback'] ) || ! is_callable( $bulk_actions[ $bulk_action ]['callback'] ) ) {
                $action_message = sprintf( __( 'The %s were not updated since an internal error occurred.', 'post-types-definitely' ), $component_plural_name );
Severity: Major
Found in inc/WPPTD/ActionHandler.php and 1 other location - About 5 hrs to fix
inc/WPPTD/ActionHandler.php on lines 441..453

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

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

        private static function get_messages_feminine( $plural_name, $singular_name ) {
            return array(
                 0 => '',
                 1 => sprintf( _x( '%s added.', 'term message: argument is the singular taxonomy label (feminine)', 'post-types-definitely' ), $singular_name ),
                 2 => sprintf( _x( '%s deleted.', 'term message: argument is the singular taxonomy label (feminine)', 'post-types-definitely' ), $singular_name ),
Severity: Major
Found in inc/WPPTD/TaxonomyLabelGenerator.php and 2 other locations - About 5 hrs to fix
inc/WPPTD/TaxonomyLabelGenerator.php on lines 169..179
inc/WPPTD/TaxonomyLabelGenerator.php on lines 209..219

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

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

        private static function get_messages_neuter( $plural_name, $singular_name ) {
            return array(
                 0 => '',
                 1 => sprintf( _x( '%s added.', 'term message: argument is the singular taxonomy label (neuter)', 'post-types-definitely' ), $singular_name ),
                 2 => sprintf( _x( '%s deleted.', 'term message: argument is the singular taxonomy label (neuter)', 'post-types-definitely' ), $singular_name ),
Severity: Major
Found in inc/WPPTD/TaxonomyLabelGenerator.php and 2 other locations - About 5 hrs to fix
inc/WPPTD/TaxonomyLabelGenerator.php on lines 169..179
inc/WPPTD/TaxonomyLabelGenerator.php on lines 189..199

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if ( ! call_user_func_array( 'current_user_can', $this->get_bulk_capability_args() ) ) {
                $action_message = sprintf( __( 'The %s were not updated because of missing privileges.', 'post-types-definitely' ), $component_plural_name );
                $error = true;
            } elseif ( empty( $bulk_actions[ $bulk_action ]['callback'] ) || ! is_callable( $bulk_actions[ $bulk_action ]['callback'] ) ) {
                $action_message = sprintf( __( 'The %s were not updated since an internal error occurred.', 'post-types-definitely' ), $component_plural_name );
Severity: Major
Found in inc/WPPTD/ActionHandler.php and 1 other location - About 5 hrs to fix
inc/WPPTD/ActionHandler.php on lines 395..407

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

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