talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function constructor has 366 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor: function(config){

    this.recipesStore = new Ext.data.JsonStore({
      url: '/admin/invitations/recipe_types.json',
      restful: true,
Severity: Major
Found in app/assets/javascripts/invitations/Invitations.js - About 1 day to fix

    Function Format has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
    Open

    Ext.util.Format = function() {
        var trimRe         = /^\s+|\s+$/g,
            stripTagsRE    = /<\/?[^>]+>/gi,
            stripScriptsRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
            nl2brRe        = /\r?\n/g;
    Severity: Minor
    Found in app/assets/javascripts/ext/src/util/Format.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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        autoSizeTabs : function(){
            var count = this.items.length,
                ce = this.tabPosition != 'bottom' ? 'header' : 'footer',
                ow = this[ce].dom.offsetWidth,
                aw = this[ce].dom.clientWidth;
    Severity: Major
    Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 1 day to fix
    app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 625..645

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 311.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        autoSizeTabs : function(){
            var count = this.items.length,
                ce = this.tabPosition != 'bottom' ? 'header' : 'footer',
                ow = this[ce].dom.offsetWidth,
                aw = this[ce].dom.clientWidth;
    app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 756..776

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 311.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        _createRoleSelectionGrid: function(){
            return this.roleSelectionGrid = new Talho.ux.RoleSelectionGrid({
                store: this.role_store,
                store_listeners:{
                    scope:this,
    Severity: Major
    Found in app/assets/javascripts/audience/AudiencePanel.js and 1 other location - About 1 day to fix
    app/assets/javascripts/audience/AudiencePanel.js on lines 111..136

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 310.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        _createGroupSelectionGrid: function(){
            return this.groupSelectionGrid = new Talho.ux.GroupSelectionGrid({
                store: this.group_store,
                store_listeners:{
                    scope:this,
    Severity: Major
    Found in app/assets/javascripts/audience/AudiencePanel.js and 1 other location - About 1 day to fix
    app/assets/javascripts/audience/AudiencePanel.js on lines 84..109

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 310.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                jQuery.each( prop, function(name, val){
                    var e = new jQuery.fx( self, opt, name );
    
                    if ( /toggle|show|hide/.test(val) )
                        e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
    Severity: Major
    Found in app/assets/javascripts/jquery.js and 1 other location - About 1 day to fix
    app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 2963..2991

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 309.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                jQuery.each( prop, function(name, val){
                    var e = new jQuery.fx( self, opt, name );
    
                    if ( /toggle|show|hide/.test(val) )
                        e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
    Severity: Major
    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 1 day to fix
    app/assets/javascripts/jquery.js on lines 3892..3920

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 309.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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 debug.js has 721 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: Major
      Found in app/assets/javascripts/ext/src/debug.js - About 1 day to fix

        Function ScrollManager has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        Ext.dd.ScrollManager = function(){
            var ddm = Ext.dd.DragDropMgr;
            var els = {};
            var dragEl = null;
            var proc = {};
        Severity: Minor
        Found in app/assets/javascripts/ext/src/dd/ScrollManager.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

        File BorderLayout.js has 696 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: Major
        Found in app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js - About 1 day to fix

          File Combo.js has 690 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: Major
          Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 1 day to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              setActiveTab : function(item){
                  item = this.getComponent(item);
                  if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
                    return;
                  }
            Severity: Major
            Found in app/assets/javascripts/ext_extensions/PillPanel.js and 1 other location - About 1 day to fix
            app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 802..833

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 282.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                setActiveTab : function(item){
                    item = this.getComponent(item);
                    if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
                        return;
                    }
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 1 day to fix
            app/assets/javascripts/ext_extensions/PillPanel.js on lines 80..111

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 282.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method import_users has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.import_users(filename, options={})
                options = {:col_sep => ",", :row_sep => :auto, :update => false, :create => true,
                           :default_jurisdiction => nil, :default_password => self.generate_random_password}.merge(options)
                CSV.open(filename, :headers => true, :col_sep => options[:col_sep], :row_sep => options[:row_sep]) do |records|
                  records.each do |rec|
            Severity: Minor
            Found in lib/user_importer.rb - 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

            File swfobject.js has 665 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: Major
            Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 1 day to fix

              Function Lightbox has 297 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Ext.ux.Lightbox = (function(){
                  var els = {},
                      images = [],
                      activeImage,
                      initialized = false,
              Severity: Major
              Found in app/assets/javascripts/ext/src/ext-core/examples/lightbox/lightbox.js - About 1 day to fix

                Function Event has 296 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Ext.lib.Event = function() {
                    var loadComplete = false,
                        unloadListeners = {},
                        retryCount = 0,
                        onAvailStack = [],
                Severity: Major
                Found in app/assets/javascripts/ext/src/ext-core/src/adapter/ext-base-event.js - About 1 day to fix

                  Function Event has 296 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  })();Ext.lib.Event = function() {
                      var loadComplete = false,
                          unloadListeners = {},
                          retryCount = 0,
                          onAvailStack = [],
                  Severity: Major
                  Found in app/assets/javascripts/ext/adapter/ext/ext-base-debug.js - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language