talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/MessageBox.js

Summary

Maintainability
F
4 days
Test Coverage

Function MessageBox has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
Open

Ext.MessageBox = function(){
    var dlg, opt, mask, waitTimer,
        bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,
        buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',
        buttonNames = ['ok', 'yes', 'no', 'cancel'];
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 1 day 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 MessageBox has 338 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Ext.MessageBox = function(){
    var dlg, opt, mask, waitTimer,
        bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,
        buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',
        buttonNames = ['ok', 'yes', 'no', 'cancel'];
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 1 day to fix

    File MessageBox.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Ext JS Library 3.3.0
     * Copyright(c) 2006-2010 Ext JS, Inc.
     * licensing@extjs.com
     * http://www.extjs.com/license
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 4 hrs to fix

      Function show has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              show : function(options){
                  if(this.isVisible()){
                      this.hide();
                  }
                  opt = options;
      Severity: Major
      Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 2 hrs to fix

        Function getDialog has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getDialog : function(titleText){
                   if(!dlg){
                        var btns = [];
                        
                        buttons = {};
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 2 hrs to fix

          Function prompt has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  prompt : function(title, msg, fn, scope, multiline, value){
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/MessageBox.js - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status