stefangabos/Zebra_Dialog

View on GitHub

Showing 6 of 35 total issues

File examples.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

$(document).ready(function() {

    var notification_options = {
        auto_close: 2000,
        modal: false,
Severity: Minor
Found in examples/examples.js - About 2 hrs to fix

    Function close has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            plugin.close = function(caption, input) {
    
                var animation_speed = plugin.settings.animation_speed_hide,
                    backdrops = $('.ZebraDialogBackdrop'),
                    dialogs = $('.ZebraDialog'),
    Severity: Minor
    Found in src/zebra_dialog.src.js - About 1 hr to fix

      Function callback has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          callback: function() {
                              new $.Zebra_Dialog('This is the second dialog box. Notice that the backdrops are not overlapping. Pressing ESC or clicking on the backdrop will close this dialog box but not the first one.', {
                                  auto_focus_button: $('body.materialize').length ? false : true,
                                  buttons: [
                                      'Close',
      Severity: Minor
      Found in examples/examples.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                        else if (compute_body_height)
        
                            plugin.body.css('height', plugin.dialog.height() -
                                ($('.ZebraDialog_Title', plugin.dialog).length ? $('.ZebraDialog_Title', plugin.dialog).outerHeight() : 0) -
                                ($('.ZebraDialog_Buttons', plugin.dialog).length ? $('.ZebraDialog_Buttons', plugin.dialog).outerHeight() : 0) -
        Severity: Major
        Found in src/zebra_dialog.src.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                          if (dialog_height + vertical_margin > viewport_height - (vertical_margin * 2))
          
                              // adjust the dialog box's body height so that it fits
                              plugin.body.css('height', viewport_height - (vertical_margin * 2) -
                                  ($('.ZebraDialog_Title', plugin.dialog).length ? $('.ZebraDialog_Title', plugin.dialog).outerHeight() : 0) -
          Severity: Major
          Found in src/zebra_dialog.src.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                            if (
            
                                // the position is given as an array
                                $.isArray(plugin.settings.position) &&
            
            
            Severity: Major
            Found in src/zebra_dialog.src.js - About 40 mins to fix
              Severity
              Category
              Status
              Source
              Language