talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

        try {
            // Set the correct header, if data is being sent
            if ( s.data )
                xhr.setRequestHeader("Content-Type", s.contentType);

Severity: Major
Found in app/assets/javascripts/jquery.js and 1 other location - About 6 hrs to fix
app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 2644..2661

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 166.

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

        try {
            // Set the correct header, if data is being sent
            if ( s.data )
                xml.setRequestHeader("Content-Type", s.contentType);

Severity: Major
Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 6 hrs to fix
app/assets/javascripts/jquery.js on lines 3520..3537

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 166.

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 ajax has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ajax: function( s ) {
        // Extend the settings, but re-extend 's' so that it can be
        // checked again later (in the test suite, specifically)
        s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));

Severity: Major
Found in app/assets/javascripts/jquery.js - About 6 hrs to fix

    ComboBox has 47 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
        /**
         * @cfg {Mixed} transform The id, DOM node or element of an existing HTML SELECT to convert to a ComboBox.
         * Note that if you specify this and the combo is going to be in an {@link Ext.form.BasicForm} or
         * {@link Ext.form.FormPanel}, you must also set <tt>{@link #lazyRender} = true</tt>.
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 6 hrs to fix

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

          data: function( elem, name, data ) {
              elem = elem == window ?
                  windowData :
                  elem;
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/jquery.js on lines 1274..1298

      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 164.

      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

          scrollToTab : function(item, animate){
              if(!item){
                  return;
              }
              var el = this.getTabEl(item),
      app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 976..990

      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 164.

      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

          scrollToTab : function(item, animate){
              if(!item){
                  return;
              }
              var el = this.getTabEl(item),
      Severity: Major
      Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 849..863

      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 164.

      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

          data: function( elem, name, data ) {
              elem = elem == window ?
                  windowData :
                  elem;
      
      Severity: Major
      Found in app/assets/javascripts/jquery.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 642..666

      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 164.

      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

              if ( gotoEnd || t >= this.options.duration + this.startTime ) {
                  this.now = this.end;
                  this.pos = this.state = 1;
                  this.update();
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 3212..3261

      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 164.

      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

              if ( gotoEnd || t > this.options.duration + this.startTime ) {
                  this.now = this.end;
                  this.pos = this.state = 1;
                  this.update();
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/jquery.js on lines 4097..4144

      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 164.

      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_groups has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.import_groups(filename, options = {})
          options = {:col_sep => ",", :row_sep => :auto}.merge(options)
          file = File.open('log/group.log', "w")
          log = Logger.new(file)
          CSV.open(filename, :headers => true, :col_sep => options[:col_sep], :row_sep => options[:row_sep]) do |records|
      Severity: Minor
      Found in lib/group_importer.rb - About 6 hrs 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

      AbstractTreeStore has 46 functions (exceeds 20 allowed). Consider refactoring.
      Open

      {
          /**
           * @cfg {String} is_leaf_field_name Record leaf flag field name.
           */
          leaf_field_name : '_is_leaf',

        AbstractTreeStore has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        {
            /**
             * @cfg {String} is_leaf_field_name Record leaf flag field name.
             */
            leaf_field_name : '_is_leaf',
        Severity: Minor
        Found in app/assets/javascripts/ext_extensions/TreeGrid/TreeGrid.js - About 6 hrs to fix

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

                  if ( event.pageX == null && event.clientX != null ) {
                      var doc = document.documentElement, body = document.body;
                      event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
                      event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
                  }
          Severity: Major
          Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 6 hrs to fix
          app/assets/javascripts/jquery.js on lines 2739..2743

          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 161.

          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

                  if ( event.pageX == null && event.clientX != null ) {
                      var doc = document.documentElement, body = document.body;
                      event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
                      event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
                  }
          Severity: Major
          Found in app/assets/javascripts/jquery.js and 1 other location - About 6 hrs to fix
          app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 2104..2108

          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 161.

          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

          File Documents.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          //= require ext_extensions/xActionColumn
          //= require ext_extensions/SubmitFalse
          //= require ext_extensions/ImageDisplayField
          //= require ./AddEditFolderWindow
          //= require ./DocumentViews
          Severity: Minor
          Found in app/assets/javascripts/documents/Documents.js - About 6 hrs to fix

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

                    {xtype: 'container', layout: 'hbox', labelAlign: 'top', items:[
                      {xtype: 'container', layout: 'form', labelAlign: 'top', width: 175, defaults:{width:175}, items:[
                        {xtype: 'textfield', fieldLabel: 'Job title', name: 'user[title]', maxLength: '46', allowBlank: true}
                      ]},
                      {xtype: 'container', layout: 'form', labelAlign: 'top', margins: '0 0 0 10', width: 175, defaults:{width:175}, items:[
            Severity: Major
            Found in app/assets/javascripts/profile/EditProfile.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/profile/EditProfile.js on lines 18..25

            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 160.

            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

                    {xtype: 'container', layout: 'hbox', labelAlign: 'top', items:[
                      {xtype: 'container', layout: 'form', labelAlign: 'top', width: 195, defaults:{width:195}, items:[
                        {xtype: 'textfield', fieldLabel: 'First name', name: 'user[first_name]', maxLength: '46', allowBlank: false}
                      ]},
                      {xtype: 'container', layout: 'form', labelAlign: 'top', margins: '0 0 0 10', width: 195, defaults:{width:195}, items:[
            Severity: Major
            Found in app/assets/javascripts/profile/EditProfile.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/profile/EditProfile.js on lines 76..83

            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 160.

            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 calculateChildBoxes has 156 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                calculateChildBoxes: function(visibleItems, targetSize) {
                    var visibleCount = visibleItems.length,
            
                        padding      = this.padding,
                        topOffset    = padding.top,
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/layout/VBoxLayout.js - About 6 hrs to fix

              Function calculateChildBoxes has 156 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  calculateChildBoxes: function(visibleItems, targetSize) {
                      var visibleCount = visibleItems.length,
              
                          padding      = this.padding,
                          topOffset    = padding.top,
              Severity: Major
              Found in app/assets/javascripts/ext/src/widgets/layout/HBoxLayout.js - About 6 hrs to fix
                Severity
                Category
                Status
                Source
                Language