static/script/15-olelo.timeago.js

Summary

Maintainability
C
1 day
Test Coverage

Avoid too many return statements within this function.
Open

    if (n < 43200)   { return $.t('n_days_ago', {n: Math.round(n / 1440)}); }
Severity: Major
Found in static/script/15-olelo.timeago.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        if (n < 525960)  { return $.t('n_months_ago', {n: Math.round(n / 43200)}); }
    Severity: Major
    Found in static/script/15-olelo.timeago.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return $.t('over_n_years_ago', {n: Math.round(n / 525960)});
      Severity: Major
      Found in static/script/15-olelo.timeago.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            if (n < 2880)    { return $.t('one_day_ago'); }
        Severity: Major
        Found in static/script/15-olelo.timeago.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              if (n < 1440)    { return $.t('n_hours_ago', {n: Math.round(n / 60)}); }
          Severity: Major
          Found in static/script/15-olelo.timeago.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                if (n < 86400)   { return $.t('one_month_ago'); }
            Severity: Major
            Found in static/script/15-olelo.timeago.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  if (n < 1051920) { return $.t('one_year_ago'); }
              Severity: Major
              Found in static/script/15-olelo.timeago.js - About 30 mins to fix

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

                         cs: {
                              less_than_a_minute_ago: 'méně než 1 minuta',
                              a_minute_ago:           'před minutou',
                              n_minutes_ago:          'před #{n} minutami',
                              one_hour_ago:           'před hodinou',
                Severity: Major
                Found in static/script/15-olelo.timeago.js and 3 other locations - About 1 hr to fix
                static/script/15-olelo.timeago.js on lines 7..19
                static/script/15-olelo.timeago.js on lines 20..32
                static/script/15-olelo.timeago.js on lines 46..58

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

                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

                         fr: {
                              less_than_a_minute_ago: "il y a moins d'une minute",
                              a_minute_ago:           "il y a une minute",
                              n_minutes_ago:          "il y a #{n} minutes",
                              one_hour_ago:           "il y a 1 heure",
                Severity: Major
                Found in static/script/15-olelo.timeago.js and 3 other locations - About 1 hr to fix
                static/script/15-olelo.timeago.js on lines 7..19
                static/script/15-olelo.timeago.js on lines 20..32
                static/script/15-olelo.timeago.js on lines 33..45

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

                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

                         en: {
                              less_than_a_minute_ago: 'less than a minute ago',
                              a_minute_ago:           'a minute ago',
                              n_minutes_ago:          '#{n} minutes ago',
                              one_hour_ago:           '1 hour ago',
                Severity: Major
                Found in static/script/15-olelo.timeago.js and 3 other locations - About 1 hr to fix
                static/script/15-olelo.timeago.js on lines 20..32
                static/script/15-olelo.timeago.js on lines 33..45
                static/script/15-olelo.timeago.js on lines 46..58

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

                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

                         de: {
                              less_than_a_minute_ago: 'vor weniger als einer Minute',
                              a_minute_ago:           'vor einer Minute',
                              n_minutes_ago:          'vor #{n} Minuten',
                              one_hour_ago:           'vor einer Stunde',
                Severity: Major
                Found in static/script/15-olelo.timeago.js and 3 other locations - About 1 hr to fix
                static/script/15-olelo.timeago.js on lines 7..19
                static/script/15-olelo.timeago.js on lines 33..45
                static/script/15-olelo.timeago.js on lines 46..58

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

                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