soderlind/read-offline

View on GitHub

Showing 1,262 of 1,262 total issues

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

            array(  // Single set of radio buttons
                'field_id'         => 'style',
                'section_id'       => 'print',
                'title'            => __( 'Print Style', 'read-offline' ),
                //'description'      => __( 'Choose one from the radio buttons.', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 4 other locations - About 4 hrs to fix
inc/class-read-offline-admin-settings.php on lines 792..810
inc/class-read-offline-admin-settings.php on lines 828..846
inc/class-read-offline-admin-settings.php on lines 899..917
inc/class-read-offline-admin-settings.php on lines 1085..1103

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

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

            array(
                'field_id'         => 'art',
                'section_id'       => 'pdf_cover',
                'title'            => __( 'Cover Art', 'read-offline' ),
                'type'             => 'revealer',
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 4 other locations - About 4 hrs to fix
inc/class-read-offline-admin-settings.php on lines 828..846
inc/class-read-offline-admin-settings.php on lines 899..917
inc/class-read-offline-admin-settings.php on lines 1085..1103
inc/class-read-offline-admin-settings.php on lines 1327..1345

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

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

            array(
                'field_id'         => 'footer',
                'section_id'       => 'pdf_footer',
                'title'            => __( 'Footer', 'read-offline' ),
                //'description'      => __( 'This is multiple sets of drop down list.', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 4 hrs to fix
inc/class-read-offline-admin-settings.php on lines 318..337
inc/class-read-offline-admin-settings.php on lines 546..566

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

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

            array(  // Single set of radio buttons
                'field_id'         => 'custom_css',
                'section_id'       => 'pdf_css',
                'title'            => __( 'Custom CSS', 'read-offline' ),
                //'description'      => __( 'Choose one from the radio buttons.',
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 4 other locations - About 4 hrs to fix
inc/class-read-offline-admin-settings.php on lines 792..810
inc/class-read-offline-admin-settings.php on lines 899..917
inc/class-read-offline-admin-settings.php on lines 1085..1103
inc/class-read-offline-admin-settings.php on lines 1327..1345

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

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

Function epub has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function epub( $post ) {

        $iso6391 = ( '' == get_locale() ) ? 'en' : strtolower( substr( get_locale(), 0, 2 ) ); // only ISO 639-1
        if ( is_rtl() ) {
            $writing_direction = EPub::DIRECTION_RIGHT_TO_LEFT;
Severity: Minor
Found in inc/class-read-offline-create.php - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        $this->addSettingFields(
            array(
                'field_id'         => 'cache',
                'section_id'       => 'misc',
                'title'            => __( 'Save in <a href="upload.php">Media Libary</a>:', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 1 other location - About 3 hrs to fix
inc/class-read-offline-admin-settings.php on lines 284..298

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

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

        $this->addSettingFields(
            array(
                'field_id'         => 'google',
                'section_id'       => 'misc',
                'title'            => __( 'Google Analytics, track downloads:', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 1 other location - About 3 hrs to fix
inc/class-read-offline-admin-settings.php on lines 268..282

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

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

            array(  // Single set of radio buttons
                'field_id'         => 'style',
                'section_id'       => 'epub',
                'title'            => __( 'ePub Style', 'read-offline' ),
                //'description'      => __( 'Choose one from the radio buttons.', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
inc/class-read-offline-admin-settings.php on lines 966..983
inc/class-read-offline-admin-settings.php on lines 1297..1314

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

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

            array(  // Single set of radio buttons
                'field_id'         => 'header',
                'section_id'       => 'print',
                'title'            => __( 'Add Print Header?', 'read-offline' ),
                //'description'      => __( 'Choose one from the radio buttons.', 'read-offline' ),
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
inc/class-read-offline-admin-settings.php on lines 966..983
inc/class-read-offline-admin-settings.php on lines 1109..1127

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

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

            array(  // Single set of radio buttons
                'field_id'         => 'protection',
                'section_id'       => 'pdf_protection',
                'title'            => __( 'Password Protection', 'read-offline' ),
                //'description'      => __( 'Choose one from the radio buttons.',
Severity: Major
Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
inc/class-read-offline-admin-settings.php on lines 1109..1127
inc/class-read-offline-admin-settings.php on lines 1297..1314

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

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

Method epub has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function epub( $post ) {

        $iso6391 = ( '' == get_locale() ) ? 'en' : strtolower( substr( get_locale(), 0, 2 ) ); // only ISO 639-1
        if ( is_rtl() ) {
            $writing_direction = EPub::DIRECTION_RIGHT_TO_LEFT;
Severity: Major
Found in inc/class-read-offline-create.php - About 3 hrs to fix

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

                    'label'            => array(
                        '0'                    => __( '-- Start --', 'read-offline' ),
                        '1'                    => __( 'H1', 'read-offline' ),
                        '2'                    => __( 'H2', 'read-offline' ),
                        '3'                    => __( 'H3', 'read-offline' ),
    Severity: Major
    Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
    inc/class-read-offline-admin-settings.php on lines 480..487
    inc/class-read-offline-admin-settings.php on lines 1007..1014

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

    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

                        'label'        => array(
                            '0'                => __( '-- Stop --', 'read-offline' ),
                            '2'                => __( 'H2', 'read-offline' ),
                            '3'                => __( 'H3', 'read-offline' ),
                            '4'                => __( 'H4', 'read-offline' ),
    Severity: Major
    Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
    inc/class-read-offline-admin-settings.php on lines 463..470
    inc/class-read-offline-admin-settings.php on lines 1007..1014

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

    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

                    'label'            => array(
                          'copy'               => __( 'Copy', 'read-offline' ),
                          'print'              => __( 'Print', 'read-offline' ),
                          'modify'             => __( 'Modify', 'read-offline' ),
                          'extract'            => __( 'Extract', 'read-offline' ),
    Severity: Major
    Found in inc/class-read-offline-admin-settings.php and 2 other locations - About 3 hrs to fix
    inc/class-read-offline-admin-settings.php on lines 463..470
    inc/class-read-offline-admin-settings.php on lines 480..487

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

    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

                    if ( true !== $wp_filesystem->rmdir( $directory , true ) ) {
                        return add_action( 'admin_notices', function() use ( $directory ) {
                                $msg[] = '<div class="error"><p>';
                                $msg[] = '<strong>Read Offline</strong>: ';
                                $msg[] = sprintf( __( 'Unable to remove cache directory "<strong>%s</strong>". Is it and its directories writable by the server?','read-offline' ), $directory );
    Severity: Major
    Found in inc/class-read-offline.php and 1 other location - About 3 hrs to fix
    inc/class-read-offline.php on lines 290..298

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

    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

                        if ( ! $wp_filesystem->mkdir( $path, FS_CHMOD_DIR ) ) {
                            return add_action( 'admin_notices', function() use ( $path ) {
                                $msg[] = '<div class="error"><p>';
                                $msg[] = '<strong>Read Offline</strong>: ';
                                $msg[] = sprintf( __( 'Unable to create directory "<strong>%s</strong>". Is its parent directory writable by the server?','read-offline' ), $path );
    Severity: Major
    Found in inc/class-read-offline.php and 1 other location - About 3 hrs to fix
    inc/class-read-offline.php on lines 315..323

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

    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

                array(
                    'field_id'         => 'icons_only',
                    'section_id'       => 'how',
                    'title'            => __( 'Download link, icons only?', 'read-offline' ),
                    'type'             => 'radio',
    Severity: Major
    Found in inc/class-read-offline-admin-settings.php and 1 other location - About 2 hrs to fix
    inc/class-read-offline-admin-settings.php on lines 427..438

    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

                array(
                    'field_id'         => 'paper_orientation',
                    'section_id'       => 'pdf_layout',
                    'title'            => __( 'Paper Orientation', 'read-offline' ),
                    'type'             => 'radio',
    Severity: Major
    Found in inc/class-read-offline-admin-settings.php and 1 other location - About 2 hrs to fix
    inc/class-read-offline-admin-settings.php on lines 223..234

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

        function epub( $attributes, $content ) {
            global $post;
            if ( ! is_object( $post ) ) { return; }
    
            $attributes = shortcode_atts( array(// default values
    Severity: Major
    Found in inc/class-read-offline-shortcode.php and 3 other locations - About 2 hrs to fix
    inc/class-read-offline-shortcode.php on lines 29..39
    inc/class-read-offline-shortcode.php on lines 53..63
    inc/class-read-offline-shortcode.php on lines 65..75

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

    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

        function prnt( $attributes, $content ) {
            global $post;
            if ( ! is_object( $post ) ) { return; }
    
            $attributes = shortcode_atts( array(// default values
    Severity: Major
    Found in inc/class-read-offline-shortcode.php and 3 other locations - About 2 hrs to fix
    inc/class-read-offline-shortcode.php on lines 29..39
    inc/class-read-offline-shortcode.php on lines 41..51
    inc/class-read-offline-shortcode.php on lines 53..63

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

    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