talho/openphin

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

Summary

Maintainability
C
1 day
Test Coverage

File Field.js has 371 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/form/Field.js - About 4 hrs to fix

    Field has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.form.Field = Ext.extend(Ext.BoxComponent,  {
        /**
         * <p>The label Element associated with this Field. <b>Only available after this Field has been rendered by a
         * {@link form Ext.layout.FormLayout} layout manager.</b></p>
         * @type Ext.Element
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/form/Field.js - About 4 hrs to fix

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

          onRender : function(ct, position){
              if(!this.el){
                  var cfg = this.getAutoCreate();
      
                  if(!cfg.name){
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/form/Field.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 onRender has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          onRender : function(ct, position){
              if(!this.el){
                  var cfg = this.getAutoCreate();
      
                  if(!cfg.name){
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/form/Field.js - About 1 hr to fix

        Function markInvalid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            markInvalid : function(msg){
                //don't set the error icon if we're not rendered or marking is prevented
                if (this.rendered && !this.preventMark) {
                    msg = msg || this.invalidText;
        
        
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/form/Field.js - About 55 mins 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 clearInvalid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            clearInvalid : function(){
                //don't remove the error icon if we're not rendered or marking is prevented
                if (this.rendered && !this.preventMark) {
                    this.el.removeClass(this.invalidClass);
                    var mt = this.getMessageHandler();
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/form/Field.js - About 45 mins 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

        There are no issues that match your filters.

        Category
        Status