soderlind/read-offline

View on GitHub
inc/class-read-offline-create.php

Summary

Maintainability
F
1 wk
Test Coverage

File class-read-offline-create.php has 789 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
use PHPePub\Core\EPub;
use PHPePub\Core\EPubChapterSplitter;
use PHPePub\Core\Logger;
use PHPePub\Core\Structure\OPF\DublinCore;
Severity: Major
Found in inc/class-read-offline-create.php - About 1 day to fix

    Method pdf has 326 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function pdf( $post ) {
    
            $html = $this->html;
    
            define( '_MPDF_TEMP_PATH', READOFFLINE_CACHE . '/tmp/' );
    Severity: Major
    Found in inc/class-read-offline-create.php - About 1 day to fix

      Function pdf has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

          function pdf( $post ) {
      
              $html = $this->html;
      
              define( '_MPDF_TEMP_PATH', READOFFLINE_CACHE . '/tmp/' );
      Severity: Minor
      Found in inc/class-read-offline-create.php - About 6 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

      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

      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

        Function _split_content has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _split_content( $html, $header ) {
        
                $all_tags   = ( 'all' === $header );
                $content    = array();
                $title      = '';
        Severity: Minor
        Found in inc/class-read-offline-create.php - About 2 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

        Function mobi has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            function mobi( $post ) {
        
                $html = $this->html;
                $mobi = new MOBI();
                /*
        Severity: Minor
        Found in inc/class-read-offline-create.php - About 2 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

        Method mobi has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function mobi( $post ) {
        
                $html = $this->html;
                $mobi = new MOBI();
                /*
        Severity: Minor
        Found in inc/class-read-offline-create.php - About 2 hrs to fix

          Method _split_content has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function _split_content( $html, $header ) {
          
                  $all_tags   = ( 'all' === $header );
                  $content    = array();
                  $title      = '';
          Severity: Minor
          Found in inc/class-read-offline-create.php - About 1 hr to fix

            Method _pdf_add_annotations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _pdf_add_annotations( $content ) {
            
                    $anchors = array();
                    $doc     = new DOMDocument();
                    // START LibXML error management.
            Severity: Minor
            Found in inc/class-read-offline-create.php - About 1 hr to fix

              Function _pdf_add_annotations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _pdf_add_annotations( $content ) {
              
                      $anchors = array();
                      $doc     = new DOMDocument();
                      // START LibXML error management.
              Severity: Minor
              Found in inc/class-read-offline-create.php - About 55 mins 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

              Function _header_footer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _header_footer( $post, $type ) {
                      $val = '';
                      switch ( $type ) {
                          case 'document_title':
                              $val = $post->post_title;
              Severity: Minor
              Found in inc/class-read-offline-create.php - About 45 mins 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

              Function _get_taxonomies_terms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _get_taxonomies_terms( $post ) {
                      // get post type by post
                      $post_type = $post->post_type;
              
                      // get post type taxonomies
              Severity: Minor
              Found in inc/class-read-offline-create.php - About 25 mins 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

              TODO found
              Open

                                  // TODO, create hieratical TOC
              Severity: Minor
              Found in inc/class-read-offline-create.php by fixme

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

                              $pdf->DefFooterByName(
                                  'pdffooter',
                                  array(
                                      'L'    => array(
                                          'content'     => ( '0' != parent::$options['pdf_footer']['default_footer'][0] ) ? $this->_header_footer( $post, parent::$options['pdf_footer']['default_footer'][0] ) : '',
              Severity: Major
              Found in inc/class-read-offline-create.php and 1 other location - About 1 day to fix
              inc/class-read-offline-create.php on lines 503..529

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

              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

                              $pdf->DefHeaderByName(
                                  'pdfheader',
                                  array(
                                      'L'    => array(
                                          'content'     => ( '0' != parent::$options['pdf_header']['default_header'][0] ) ? $this->_header_footer( $post, parent::$options['pdf_header']['default_header'][0] ) : '',
              Severity: Major
              Found in inc/class-read-offline-create.php and 1 other location - About 1 day to fix
              inc/class-read-offline-create.php on lines 548..574

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

              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 ( ( '0' == parent::$options['pdf_header']['default_header'][0] &&
                                   '0' == parent::$options['pdf_header']['default_header'][1] &&
                                   '0' == parent::$options['pdf_header']['default_header'][2] ) ) {
              Severity: Major
              Found in inc/class-read-offline-create.php and 1 other location - About 1 hr to fix
              inc/class-read-offline-create.php on lines 543..545

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

              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

                                  ( '0' == parent::$options['pdffooter']['default_footer'][0] &&
                                   '0' == parent::$options['pdffooter']['default_footer'][1] &&
                                   '0' == parent::$options['pdffooter']['default_footer'][2] ) ) {
              Severity: Major
              Found in inc/class-read-offline-create.php and 1 other location - About 1 hr to fix
              inc/class-read-offline-create.php on lines 498..500

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

              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

                          $toc_stop  = ( '0' == parent::$options['pdf_layout']['toc'][1] ) ? 2 : parent::$options['pdf_layout']['toc'][1];
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 50 mins to fix
              inc/class-read-offline-create.php on lines 708..708

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

              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

                          $toc_start = ( '0' == parent::$options['pdf_layout']['toc'][0] ) ? 1 : parent::$options['pdf_layout']['toc'][0];
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 50 mins to fix
              inc/class-read-offline-create.php on lines 709..709

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

              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->author_firstlast = sprintf( '%s %s', get_the_author_meta( 'user_firstname', $post->post_author ), get_the_author_meta( 'user_lastname', $post->post_author ) );
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 45 mins to fix
              inc/class-read-offline-create.php on lines 42..42

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

              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->author_lastfirst = sprintf( '%s, %s', get_the_author_meta( 'user_firstname', $post->post_author ), get_the_author_meta( 'user_lastname', $post->post_author ) );
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 45 mins to fix
              inc/class-read-offline-create.php on lines 41..41

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

              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

                          case 'css':
                              $print_css = ( '' != parent::$options['print']['css'] ) ? parent::$options['print']['css'] : '';
                              break;
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 40 mins to fix
              inc/class-read-offline-create.php on lines 124..126

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

              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

                          case 'css':
                              $print_css = ( '' != parent::$options['epub']['css'] ) ? parent::$options['epub']['css'] : '';
                              break;
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 40 mins to fix
              inc/class-read-offline-create.php on lines 76..78

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

              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 ( '' != $image_url ) {
                                      $pdf->AddPageByArray(
                                          array(
                                              'suppress' => 'on', // supress header
                                          )
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 40 mins to fix
              inc/class-read-offline-create.php on lines 665..678

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

              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 ( '' != $image_url ) {
                                      $pdf->AddPageByArray(
                                          array(
                                              'suppress' => 'on', // supress header
                                          )
              Severity: Minor
              Found in inc/class-read-offline-create.php and 1 other location - About 40 mins to fix
              inc/class-read-offline-create.php on lines 641..656

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

              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

              Found precision alignment of 1 spaces.
              Open

                                   '0' == parent::$options['pdf_header']['default_header'][2] ) ) {

              Equals sign not aligned correctly; expected 1 space but found 4 spaces
              Open

                              $levels    = array_map(

              Found precision alignment of 1 spaces.
              Open

                                   '0' == parent::$options['pdffooter']['default_footer'][1] &&

              Space found before comma in function call
              Open

                      if ( strpos( $href, '//' ) !== 0 && in_array( substr( $href, 0, 1 ) , array( '/', '#', '?' ), true ) ) {

              Found precision alignment of 1 spaces.
              Open

                                   '0' == parent::$options['pdffooter']['default_footer'][2] ) ) {

              Simple placeholders should not be quoted in the query string in $wpdb->prepare(). Found: '%s'.
              Open

                          $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) );

              Equals sign not aligned with surrounding assignments; expected 2 spaces but found 3 spaces
              Open

                      $this->html   = '<h1 class="entry-title">' . get_the_title( $post->ID ) . '</h1>';

              Functions must not contain multiple empty lines in a row; found 2 empty lines
              Open

              
              

              Assignments must be the first block of code on a line
              Open

                      for ( $i = 0, $len = sizeof( $entries ); $i < $len; $i++ ) {

              Assignments must be the first block of code on a line
              Open

                              if ( false !== ( $ref = $node->getAttribute( 'href' ) ) && false !== stristr( $ref, 'note' ) ) {

              Found precision alignment of 1 spaces.
              Open

                                   '0' == parent::$options['pdf_header']['default_header'][1] &&

              There are no issues that match your filters.

              Category
              Status