CaffGeek/MBACNationals

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

Summary

Maintainability
F
3 wks
Test Coverage

File Date.php has 697 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/Parse/Date.php - About 1 day to fix

    Function remove_rfc2822_comments has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        public function remove_rfc2822_comments($string)
        {
            $string = (string) $string;
            $position = 0;
            $length = strlen($string);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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 date_rfc2822 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function date_rfc2822($date)
        {
            static $pcre;
            if (!$pcre)
            {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php - About 2 hrs to fix

      Function date_rfc2822 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function date_rfc2822($date)
          {
              static $pcre;
              if (!$pcre)
              {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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 remove_rfc2822_comments has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function remove_rfc2822_comments($string)
          {
              $string = (string) $string;
              $position = 0;
              $length = strlen($string);
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php - About 1 hr to fix

        Function date_w3cdtf has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            public function date_w3cdtf($date)
            {
                static $pcre;
                if (!$pcre)
                {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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 date_w3cdtf has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function date_w3cdtf($date)
            {
                static $pcre;
                if (!$pcre)
                {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php - About 1 hr to fix

          Method date_rfc850 has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function date_rfc850($date)
              {
                  static $pcre;
                  if (!$pcre)
                  {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php - About 1 hr to fix

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

                public function date_rfc850($date)
                {
                    static $pcre;
                    if (!$pcre)
                    {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct()
                {
                    $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
                    $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';
            
            
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function parse($date)
                {
                    foreach ($this->user as $method)
                    {
                        if (($returned = call_user_func($method, $date)) !== false)
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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

                var $timezone = array(
                    'ACDT' => 37800,
                    'ACIT' => 28800,
                    'ACST' => 34200,
                    'ACT' => -18000,
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 6 days to fix
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 12776..12976

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

            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

                var $month = array(
                    // English
                    'jan' => 1,
                    'january' => 1,
                    'feb' => 2,
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 3 days to fix
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 12631..12768

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

            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 date_rfc2822($date)
                {
                    static $pcre;
                    if (!$pcre)
                    {
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 2 days to fix
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13244..13329

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

            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 date_w3cdtf($date)
                {
                    static $pcre;
                    if (!$pcre)
                    {
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 2 days to fix
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13112..13175

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

            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

                var $day = array(
                    // English
                    'mon' => 1,
                    'monday' => 1,
                    'tue' => 2,
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 12542..12623

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

            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 date_rfc850($date)
                {
                    static $pcre;
                    if (!$pcre)
                    {
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13337..13394

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

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

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

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

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

            Refactorings

            Further Reading

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

                public function remove_rfc2822_comments($string)
                {
                    $string = (string) $string;
                    $position = 0;
                    $length = strlen($string);
            Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php on lines 1769..1821
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 10873..10925
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13184..13236

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

            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 date_asctime($date)
                {
                    static $pcre;
                    if (!$pcre)
                    {
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13402..13436

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

            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 __construct()
                {
                    $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
                    $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';
            
            
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13016..13039

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

            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 parse($date)
                {
                    foreach ($this->user as $method)
                    {
                        if (($returned = call_user_func($method, $date)) !== false)
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 45 mins to fix
            Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13064..13083

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

            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