koss-lebedev/bootstrap-cron-picker

View on GitHub

Showing 6 of 16 total issues

File cron-picker.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function ($) {

    class CronPicker {

        constructor(wrapper, hostControl, options) {
Severity: Minor
Found in src/cron-picker.js - About 3 hrs to fix

    Function _buildMonthlyFilter has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _buildMonthlyFilter() {
                const self = this;
                const dayButton = this._buildFilterButton('day');
                const weekDayButton = this._buildFilterButton('weekday');
    
    
    Severity: Major
    Found in src/cron-picker.js - About 2 hrs to fix

      Function parse has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      QuartzCronFormatter.parse = function (cron) {
          const state = {};
          const parts = cron.split(' ');
          if (parts.length !== 7) {
              console.warn('Invalid cron expression. Skip parsing...');
      Severity: Minor
      Found in src/quartz-cron-formatter.js - 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

      Function _updateUI has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _updateUI() {
                  // Set controls value based on current state
      
                  this.wrapper.find('li').removeClass('active');
                  this.wrapper.find(`[data-type=${this.state.type}]`).addClass('active');
      Severity: Minor
      Found in src/cron-picker.js - About 1 hr to fix

        Function parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        StandardCronFormatter.parse = function (cron) {
            const state = {};
            const parts = cron.split(' ');
            if (parts.length !== 5 && parts.length !== 6) {
                console.warn('Invalid cron expression. Skip parsing...');
        Severity: Minor
        Found in src/standard-cron-formatter.js - 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

        Function parse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        QuartzCronFormatter.parse = function (cron) {
            const state = {};
            const parts = cron.split(' ');
            if (parts.length !== 7) {
                console.warn('Invalid cron expression. Skip parsing...');
        Severity: Minor
        Found in src/quartz-cron-formatter.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language