CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/import/dotclear.php

Summary

Maintainability
F
6 days
Test Coverage

File dotclear.php has 532 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * DotClear Importer
 *
 * @package WordPress
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 1 day to fix

    Function users2wp has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        function users2wp($users='')
        {
            // General Housekeeping
            global $wpdb;
            $count = 0;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 7 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 dispatch has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        function dispatch()
        {
    
            if (empty ($_GET['step']))
                $step = 0;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.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 posts2wp has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        function posts2wp($posts='')
        {
            // General Housekeeping
            global $wpdb;
            $count = 0;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 3 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 posts2wp has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function posts2wp($posts='')
        {
            // General Housekeeping
            global $wpdb;
            $count = 0;
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 3 hrs to fix

      Method dispatch has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function dispatch()
          {
      
              if (empty ($_GET['step']))
                  $step = 0;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 2 hrs to fix

        Dotclear_Import has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Dotclear_Import {
        
            function header()
            {
                echo '<div class="wrap">';
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 2 hrs to fix

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

              function links2wp($links='')
              {
                  // General Housekeeping
                  global $wpdb;
                  $count = 0;
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.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 users2wp has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function users2wp($users='')
              {
                  // General Housekeeping
                  global $wpdb;
                  $count = 0;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 2 hrs to fix

            Method links2wp has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function links2wp($links='')
                {
                    // General Housekeeping
                    global $wpdb;
                    $count = 0;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 1 hr to fix

              Method comments2wp has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function comments2wp($comments='')
                  {
                      // General Housekeeping
                      global $wpdb;
                      $count = 0;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 1 hr to fix

                Method cat2wp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function cat2wp($categories='')
                    {
                        // General Housekeeping
                        global $wpdb;
                        $count = 0;
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 1 hr to fix

                  Function cat2wp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function cat2wp($categories='')
                      {
                          // General Housekeeping
                          global $wpdb;
                          $count = 0;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 35 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 comments2wp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function comments2wp($comments='')
                      {
                          // General Housekeeping
                          global $wpdb;
                          $count = 0;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 35 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

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

                      function get_dc_cats()
                      {
                          global $wpdb;
                          // General Housekeeping
                          $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php and 5 other locations - About 1 hr to fix
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 128..139
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 154..164
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 78..94
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 96..113
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 141..151

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

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

                      function get_dc_comments()
                      {
                          global $wpdb;
                          // General Housekeeping
                          $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php and 5 other locations - About 1 hr to fix
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 116..126
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 128..139
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 78..94
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 96..113
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 141..151

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

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

                      function get_dc_users()
                      {
                          global $wpdb;
                          // General Housekeeping
                          $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php and 5 other locations - About 1 hr to fix
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 116..126
                  Web.Admin/2014/wordpress/wp-admin/import/dotclear.php on lines 154..164
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 78..94
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 96..113
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 141..151

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

                  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

                          switch ($step)
                          {
                              default:
                              case 0 :
                                  $this->greet();
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php and 1 other location - About 1 hr to fix
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 650..676

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

                  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

                      function get_dc_links()
                      {
                          //General Housekeeping
                          $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
                          set_magic_quotes_runtime(0);
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php and 2 other locations - About 1 hr to fix
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 115..139
                  Web.Admin/2014/wordpress/wp-admin/import/textpattern.php on lines 153..169

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

                  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

                  There are no issues that match your filters.

                  Category
                  Status