frisb/timeously

View on GitHub
lib/timeously.js

Summary

Maintainability
F
1 wk
Test Coverage

File timeously.js has 667 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! timeously v0.2.2 (Sat, 7 Apr 2018 02:09:32)

Timeous interval creation for precise milestone events
@module timeously
@author Ashley Brener <ashley@frisb.com>
Severity: Major
Found in lib/timeously.js - About 1 day to fix

    Function TimeBucket has 165 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var TimeBucket = function () {
            function TimeBucket(date) {
                (0, _classCallCheck3.default)(this, TimeBucket);
        
                if (!date) {
    Severity: Major
    Found in lib/timeously.js - About 6 hrs to fix

      Function Timeously has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Timeously = function () {
            function Timeously(options, callback) {
              (0, _classCallCheck3.default)(this, Timeously);
              var name = options.name,
                  interval = options.interval,
      Severity: Major
      Found in lib/timeously.js - About 6 hrs to fix

        Function calculateNextTimeout has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                value: function calculateNextTimeout() {
                  var name = this.name,
                      title = this.title,
                      interval = this.interval,
                      intervalType = this.intervalType,
        Severity: Major
        Found in lib/timeously.js - About 2 hrs to fix

          Function TimeSpan has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var TimeSpan = function () {
                function TimeSpan(millisec) {
                  (0, _classCallCheck3.default)(this, TimeSpan);
              
              
          Severity: Minor
          Found in lib/timeously.js - About 1 hr to fix

            Function $export has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var $export = function (type, name, source) {
                  var IS_FORCED = type & $export.F;
                  var IS_GLOBAL = type & $export.G;
                  var IS_STATIC = type & $export.S;
                  var IS_PROTO = type & $export.P;
            Severity: Minor
            Found in lib/timeously.js - About 1 hr to fix

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

                        if (startTime) {
                          if (!started) {
                            this.started = true;
                            nextEvent[intervalType] += currTime > startTime ? limit - currTime + startTime : startTime - currTime;
                          } else {
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 day to fix
              src/index.js on lines 154..182

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

              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

                        for (var i = 6; i >= 0; i--) {
                          var interv = intervals[i];
                          if (interv === intervalType) break;
                  
                          switch (interv) {
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 3 hrs to fix
              src/index.js on lines 131..147

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

              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

                          value: function tz(timezone) {
                              if (!timezone) timezone = 'GMT';
                  
                              this.tzOffsetMinutes = moment.tz(timezone).utcOffset();
                              this.minute += this.tzOffsetMinutes - localOffsetMinutes;
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 hr to fix
              src/timebucket.js on lines 43..50

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

              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

                      value: function execute() {
                        var self = this;
                  
                        if (!self.timerID) return;
                  
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 hr to fix
              src/index.js on lines 81..94

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

              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

                  function validTime(currTime, startTime, stopTime) {
                    if (!startTime || !stopTime) return true;
                  
                    if (startTime < stopTime) return currTime >= startTime && currTime <= stopTime;
                  
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 hr to fix
              src/index.js on lines 27..35

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

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

                      }, {
                          key: 'dayOfWeek',
                          get: function get() {
                              return this.date.getDay();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'millisecond',
                          get: function get() {
                              return this.date.getMilliseconds();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'month',
                          get: function get() {
                              return this.date.getMonth();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'minute',
                          get: function get() {
                              return this.date.getMinutes();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'second',
                          get: function get() {
                              return this.date.getSeconds();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'hour',
                          get: function get() {
                              return this.date.getHours();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'day',
                          get: function get() {
                              return this.date.getDate();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886
              lib/timeously.js on lines 891..899

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

                      }, {
                          key: 'year',
                          get: function get() {
                              return this.date.getFullYear();
                          },
              Severity: Major
              Found in lib/timeously.js and 7 other locations - About 1 hr to fix
              lib/timeously.js on lines 825..833
              lib/timeously.js on lines 833..841
              lib/timeously.js on lines 841..849
              lib/timeously.js on lines 849..857
              lib/timeously.js on lines 857..865
              lib/timeously.js on lines 865..873
              lib/timeously.js on lines 878..886

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

                          if (!date) {
                              date = new Date();
                          } else if (typeof date === 'string') {
                              date = new Date(date);
                          } else {
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 hr to fix
              src/timebucket.js on lines 9..17

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

              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

                      this.sec = ~~(totalsec - this.days * 86400 - this.hours * 3600 - this.mins * 60); // + 1; removing to test exports delta
              Severity: Major
              Found in lib/timeously.js and 1 other location - About 1 hr to fix
              src/timespan.js on lines 18..18

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

              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

                                  return format.replace('yyyy', this.year.toString()).replace('yy', this.year.toString().substr(2)).replace('MM', (0, _pad2.default)(this.month + 1)).replace('dd', (0, _pad2.default)(this.day)).replace('HH', (0, _pad2.default)(this.hour)).replace('mm', (0, _pad2.default)(this.minute)).replace('ss', (0, _pad2.default)(this.second)).replace('SSS', (0, _pad2.default)(this.millisecond, 3)).replace('Z', this.offsetString);
              Severity: Minor
              Found in lib/timeously.js and 1 other location - About 55 mins to fix
              src/timebucket.js on lines 63..66

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

              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

                          value: function toUTCDate() {
                              var d = new Date(this.date);
                              d.setMinutes(d.getMinutes() - this.tzOffsetMinutes + localOffsetMinutes);
                              return d;
                          }
              Severity: Minor
              Found in lib/timeously.js and 1 other location - About 50 mins to fix
              src/timebucket.js on lines 83..87

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

              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

                      this.mins = ~~((totalsec - this.days * 86400 - this.hours * 3600) / 60);
              Severity: Minor
              Found in lib/timeously.js and 1 other location - About 35 mins to fix
              src/timespan.js on lines 16..16

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

              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