talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function _validateFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    _validateFile: function(file){
        var name, size;
        
        if (file.value){
            // it is a file input            
Severity: Minor
Found in app/assets/javascripts/lib/fileuploader.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 constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  constructor: function(config){
    Talho.FindPeople.superclass.constructor.call(this, config);

    this.admin_mode = config.admin_mode;
    this.rolesStore = new Ext.data.JsonStore({
Severity: Minor
Found in app/assets/javascripts/search/FindPeople.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

Method index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def index
    urls = params[:urls].to_a.reject{|u| u.blank?}
    urls.each{|u| u.insert(0, "http://") } #clean up urls to ensure they're lead by http://
    feed = Feedzirra::Feed.fetch_and_parse(urls) unless urls.blank?
    sleep 1
Severity: Minor
Found in app/controllers/rss_feed_controller.rb - 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

Method destroy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def destroy
    role_assignment = RoleMembership.find(params[:id])
    if role_assignment.blank?
      flash[:error] = "Invalid role membership specified"
      if session[:return_to].blank?
Severity: Minor
Found in app/controllers/admin/role_assignments_controller.rb - 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

Method new has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def self.new( attributes = {}, options = {} )
    shared_attr = attributes[:shared]
    attributes.delete(:shared)
    audience_attr = attributes[:audience]
    attributes.delete(:audience)
Severity: Minor
Found in app/models/folder.rb - 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

Method choose_layout has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def choose_layout
    if signed_in?
      if request.xhr? || request.format.ext?
        if request.format.json? 
          false
Severity: Minor
Found in app/controllers/application_controller.rb - 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 moveItem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        moveItem: function(mode){
            var sel = this.current_selections[0];
            var type = sel.get('type');

            if(sel.get('id') == null || sel.get('id') == 'null') return;
Severity: Minor
Found in app/assets/javascripts/documents/DocumentViews.js - About 1 hr to fix

    Function showFiles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        showFiles: function(record){
            var store = new Talho.ux.Documents.FileStore({
                url: '/folders/' + record.get('id') + '.json',
                autoLoad: true,
                listeners: {
    Severity: Minor
    Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

      Function initComponent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        initComponent: function(){
          this.addEvents('back');
      
          this.group_detail_panel = new Ext.Panel({
            layout: 'form',
      Severity: Minor
      Found in app/assets/javascripts/groups/view/detail.js - About 1 hr to fix

        Function _sort has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _sort : function(property, dir, fn){
                var i, len,
                    dsc   = String(dir).toUpperCase() == 'DESC' ? -1 : 1,
        
                    //this is a temporary array used to apply the sorting function
        Severity: Minor
        Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 1 hr to fix

          Function removeChild has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              removeChild : function(node, destroy){
                  var index = this.childNodes.indexOf(node);
                  if(index == -1){
                      return false;
                  }
          Severity: Minor
          Found in app/assets/javascripts/ext/src/data/Tree.js - About 1 hr to fix

            Function sortData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                sortData : function() {
                    var sortInfo  = this.hasMultiSort ? this.multiSortInfo : this.sortInfo,
                        direction = sortInfo.direction || "ASC",
                        sorters   = sortInfo.sorters,
                        sortFns   = [];
            Severity: Minor
            Found in app/assets/javascripts/ext/src/data/Store.js - About 1 hr to fix

              Function bindStore has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  bindStore : function(store, initial){
                      var doLoad;
                      if(!initial && this.store){
                          if(store !== this.store && this.store.autoDestroy){
                              this.store.destroy();
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js - About 1 hr to fix

                Function testPlayerVersion has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function testPlayerVersion() {
                        var b = doc.getElementsByTagName("body")[0];
                        var o = createElement(OBJECT);
                        o.setAttribute("type", FLASH_MIME_TYPE);
                        var t = b.appendChild(o);
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 1 hr to fix

                  Function getNextCell has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      getNextCell : function(c){
                          var cell = this.getNextNonSpan(this.currentColumn, this.currentRow);
                          var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1];
                          for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){
                              if(!this.cells[rowIndex]){
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/widgets/layout/TableLayout.js - About 1 hr to fix

                    Function processEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        processEvent : function(name, e) {
                            var target = e.getTarget(),
                                grid   = this.grid,
                                header = this.findHeaderIndex(target),
                                row, cell, col, body;
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                          constructor : function(grid, store){
                              var g = Ext.grid,
                                  f = Ext.form;
                                  
                              this.grid = grid;
                      Severity: Minor
                      Found in app/assets/javascripts/ext/src/widgets/grid/PropertyGrid.js - About 1 hr to fix

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

                            constructor: function(elId, config) {
                                config = config || {};
                                Ext.apply(this, config);
                        
                                Ext.ux.Carousel.superclass.constructor.call(this, config);

                          Function realign has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              realign: function(l, t, w, h) {
                                  if (!this.el) {
                                      return;
                                  }
                                  var a = this.adjusts,
                          Severity: Minor
                          Found in app/assets/javascripts/ext/src/widgets/Shadow.js - About 1 hr to fix

                            Function createScrollers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                createScrollers : function(){
                                    if(!this.scroller){
                                        this.scroller = {
                                            pos: 0,
                                            top: this.el.insertFirst({
                            Severity: Minor
                            Found in app/assets/javascripts/ext/src/widgets/menu/Menu.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language