CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php

Summary

Maintainability
F
2 wks
Test Coverage

File Source.php has 522 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * SimplePie
 *
 * A PHP-Based RSS and Atom Feed Framework.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 day to fix

    Function get_links has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_links($rel = 'alternate')
        {
            if (!isset($this->data['links']))
            {
                $this->data['links'] = array();
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 5 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 get_authors has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_authors()
        {
            $authors = array();
            foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
            {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.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

    Function get_contributors has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_contributors()
        {
            $contributors = array();
            foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
            {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.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 get_links has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_links($rel = 'alternate')
        {
            if (!isset($this->data['links']))
            {
                $this->data['links'] = array();
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 2 hrs to fix

      Method get_authors has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function get_authors()
          {
              $authors = array();
              foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
              {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 2 hrs to fix

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

        class SimplePie_Source
        {
            var $item;
            var $data = array();
            protected $registry;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 2 hrs to fix

          Method get_contributors has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_contributors()
              {
                  $contributors = array();
                  foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
                  {
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 2 hrs to fix

            Method get_categories has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get_categories()
                {
                    $categories = array();
            
                    foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 hr to fix

              Function get_categories has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function get_categories()
                  {
                      $categories = array();
              
                      foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 hr 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 get_description has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_description()
                  {
                      if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
                      {
                          return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 hr to fix

                Method get_title has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function get_title()
                    {
                        if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
                        {
                            return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 hr to fix

                  Function get_description has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function get_description()
                      {
                          if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
                          {
                              return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 1 hr 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_title has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function get_title()
                      {
                          if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
                          {
                              return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.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

                  Avoid too many return statements within this method.
                  Open

                              return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return null;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return null;
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return null;
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return null;
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
                                    Severity: Major
                                    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                      Severity: Major
                                      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
                                        Severity: Major
                                        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
                                          Severity: Major
                                          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php - About 30 mins to fix

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

                                                public function get_copyright()
                                                {
                                                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
                                                    {
                                                        return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
                                            Severity: Minor
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.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

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

                                                public function get_contributors()
                                                {
                                                    $contributors = array();
                                                    foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
                                                    {
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 4 days to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 543..599

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                public function get_categories()
                                                {
                                                    $categories = array();
                                            
                                                    foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 2 days to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 438..493

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

                                            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 ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
                                                    {
                                                        $name = null;
                                                        $url = null;
                                                        $email = null;
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 1 day to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 634..655

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                        foreach ($keys as $key)
                                                        {
                                                            if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
                                                            {
                                                                if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 1 day to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1018..1037

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                public function get_image_url()
                                                {
                                                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))
                                                    {
                                                        return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 4 hrs to fix
                                            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 6255..6273

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                public function get_language()
                                                {
                                                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
                                                    {
                                                        return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 4 hrs to fix
                                            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 6195..6217

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                public function get_longitude()
                                                {
                                                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
                                                    {
                                                        return (float) $return[0]['data'];
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 2 hrs to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 2926..2944

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                public function get_latitude()
                                                {
                                                    if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
                                                    {
                                                        return (float) $return[0]['data'];
                                            Severity: Major
                                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 1 hr to fix
                                            Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 2898..2912

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

                                            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