gabynaiman/timing

View on GitHub

Showing 152 of 152 total issues

Method _nt_long_month_name has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def _nt_long_month_name
      start_index = index
      if node_cache[:long_month_name].has_key?(index)
        cached = node_cache[:long_month_name][index]
        if cached
Severity: Major
Found in lib/timing/natural_time_language.rb - About 5 hrs to fix

    Method _nt_time_ago has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_time_ago
          start_index = index
          if node_cache[:time_ago].has_key?(index)
            cached = node_cache[:time_ago][index]
            if cached
    Severity: Minor
    Found in lib/timing/natural_time_language.rb - 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

    Method _nt_moment_at_time has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_moment_at_time
          start_index = index
          if node_cache[:moment_at_time].has_key?(index)
            cached = node_cache[:moment_at_time][index]
            if cached
    Severity: Minor
    Found in lib/timing/natural_time_language.rb - 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

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

        def _nt_end_of
          start_index = index
          if node_cache[:end_of].has_key?(index)
            cached = node_cache[:end_of][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 1 other location - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1286..1339

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

    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

        def _nt_beginning_of
          start_index = index
          if node_cache[:beginning_of].has_key?(index)
            cached = node_cache[:beginning_of][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 1 other location - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1349..1402

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

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

        def _nt_day_interval
          start_index = index
          if node_cache[:day_interval].has_key?(index)
            cached = node_cache[:day_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1796..1841
    lib/timing/natural_time_language.rb on lines 1847..1892

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

        def _nt_second_interval
          start_index = index
          if node_cache[:second_interval].has_key?(index)
            cached = node_cache[:second_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1796..1841
    lib/timing/natural_time_language.rb on lines 1847..1892

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

        def _nt_week_interval
          start_index = index
          if node_cache[:week_interval].has_key?(index)
            cached = node_cache[:week_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1796..1841
    lib/timing/natural_time_language.rb on lines 1847..1892

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

        def _nt_year_interval
          start_index = index
          if node_cache[:year_interval].has_key?(index)
            cached = node_cache[:year_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1796..1841

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

        def _nt_month_interval
          start_index = index
          if node_cache[:month_interval].has_key?(index)
            cached = node_cache[:month_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1847..1892

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

        def _nt_minute_interval
          start_index = index
          if node_cache[:minute_interval].has_key?(index)
            cached = node_cache[:minute_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1643..1688
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1796..1841
    lib/timing/natural_time_language.rb on lines 1847..1892

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

        def _nt_hour_interval
          start_index = index
          if node_cache[:hour_interval].has_key?(index)
            cached = node_cache[:hour_interval][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb and 6 other locations - About 4 hrs to fix
    lib/timing/natural_time_language.rb on lines 1541..1586
    lib/timing/natural_time_language.rb on lines 1592..1637
    lib/timing/natural_time_language.rb on lines 1694..1739
    lib/timing/natural_time_language.rb on lines 1745..1790
    lib/timing/natural_time_language.rb on lines 1796..1841
    lib/timing/natural_time_language.rb on lines 1847..1892

    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

    Method _nt_year_month_day has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_year_month_day
          start_index = index
          if node_cache[:year_month_day].has_key?(index)
            cached = node_cache[:year_month_day][index]
            if cached
    Severity: Minor
    Found in lib/timing/natural_time_language.rb - 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 _nt_date_moment has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_date_moment
          start_index = index
          if node_cache[:date_moment].has_key?(index)
            cached = node_cache[:date_moment][index]
            if cached
    Severity: Minor
    Found in lib/timing/natural_time_language.rb - 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 _nt_moment has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_moment
          start_index = index
          if node_cache[:moment].has_key?(index)
            cached = node_cache[:moment][index]
            if cached
    Severity: Minor
    Found in lib/timing/natural_time_language.rb - 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 _nt_zone_offset has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _nt_zone_offset
          start_index = index
          if node_cache[:zone_offset].has_key?(index)
            cached = node_cache[:zone_offset][index]
            if cached
    Severity: Major
    Found in lib/timing/natural_time_language.rb - About 3 hrs to fix

      Method _nt_short_day_name has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _nt_short_day_name
            start_index = index
            if node_cache[:short_day_name].has_key?(index)
              cached = node_cache[:short_day_name][index]
              if cached
      Severity: Major
      Found in lib/timing/natural_time_language.rb - About 3 hrs to fix

        Method _nt_long_day_name has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _nt_long_day_name
              start_index = index
              if node_cache[:long_day_name].has_key?(index)
                cached = node_cache[:long_day_name][index]
                if cached
        Severity: Major
        Found in lib/timing/natural_time_language.rb - About 3 hrs to fix

          Method _nt_end_of has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_end_of
                start_index = index
                if node_cache[:end_of].has_key?(index)
                  cached = node_cache[:end_of][index]
                  if cached
          Severity: Minor
          Found in lib/timing/natural_time_language.rb - 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 _nt_beginning_of has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_beginning_of
                start_index = index
                if node_cache[:beginning_of].has_key?(index)
                  cached = node_cache[:beginning_of][index]
                  if cached
          Severity: Minor
          Found in lib/timing/natural_time_language.rb - 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

          Severity
          Category
          Status
          Source
          Language