frisb/timeously

View on GitHub

Showing 10 of 38 total issues

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 a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

          calculateNextTimeout() {
            let {name, title, interval, intervalType, started, now, startTime, stopTime} = this;
        
            let limit = getLimit(intervalType, now);
        
        
        Severity: Minor
        Found in src/index.js - About 4 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

        TimeBucket has 31 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class TimeBucket {
            constructor(date) {
                if (!date) {
                    date = new Date();
                }
        Severity: Minor
        Found in src/timebucket.js - About 3 hrs to fix

          Function exports has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (grunt) {
            grunt.initConfig({
              pkg: grunt.file.readJSON('package.json'),
              headline: '<%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("ddd, d mmm yyyy hh:MM:ss") %>)',
              license: grunt.file.read('LICENSE'),
          Severity: Major
          Found in Gruntfile.js - About 3 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 calculateNextTimeout has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                calculateNextTimeout() {
                  let {name, title, interval, intervalType, started, now, startTime, stopTime} = this;
              
                  let limit = getLimit(intervalType, now);
              
              
              Severity: Minor
              Found in src/index.js - About 1 hr 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
                    Severity
                    Category
                    Status
                    Source
                    Language