talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Method perform_delivery has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perform_delivery
    # find the title, sender, and other things that are static
    @title = message.Messages.select {|m| m.name == 'title' }.first.Value
    if !message.Author
      @sender = DO_NOT_REPLY
Severity: Minor
Found in app/models/service/talho/email/message.rb - About 1 hr to fix

    Method import_groups has 32 lines of code (exceeds 25 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 1 hr to fix

      Method activate_music has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def activate_music
          body = ""
          xml = ::Builder::XmlMarkup.new :target => body, :indent => 2
          xml.instruct!
          xml.ucsxml :version=>"1.1", :xmlns=>"http://ucs.tfcci.com" do |ucsxml|
      Severity: Minor
      Found in doc/21cc_spike.rb - About 1 hr to fix

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

            addAll : function(objs){
                if(arguments.length > 1 || Ext.isArray(objs)){
                    var args = arguments.length > 1 ? arguments : objs;
                    for(var i = 0, len = args.length; i < len; i++){
                        this.add(args[i]);
        Severity: Minor
        Found in app/assets/javascripts/ext/src/util/MixedCollection.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 onMouseDown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            onMouseDown: function(e, target){
                if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){
                    this.startXY = this.lastXY = e.getXY();
                    this.dragTarget = this.delegate ? target : this.el.dom;
                    if(this.preventDefault !== false){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/dd/DragTracker.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 brMoney has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          Ext.util.Format.brMoney = function(v){
            v = (Math.round((v - 0) * 100)) / 100;
            v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v * 10)) ? v + "0" : v);
            v = String(v);
            var ps = v.split('.');
        Severity: Minor
        Found in app/assets/javascripts/ext/src/locale/ext-lang-pt_BR.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 parseChildItems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            parseChildItems: function(n) {
                var cn = n.attributes.component.items;
                if (cn) {
                    for (var i = 0;i < cn.length; i++) {
                        var c = cn.get(i);
        Severity: Minor
        Found in app/assets/javascripts/ext/src/debug.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 autoScroll has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            autoScroll: function(x, y, h, w) {
        
                if (this.scroll) {
                    // The client height
                    var clientH = Ext.lib.Dom.getViewHeight();
        Severity: Minor
        Found in app/assets/javascripts/ext/src/dd/DDCore.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 connect has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            connect: function(){
                if(this.url && !this.pollTask){
                    this.pollTask = Ext.TaskMgr.start({
                        run: function(){
                            if(this.fireEvent('beforepoll', this) !== false){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/direct/PollingProvider.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 sort has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            sort : function(fn, scope){
                var cs = this.childNodes;
                var len = cs.length;
                if(len > 0){
                    var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/data/Tree.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 completeDrop has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            completeDrop : function(de){
                var ns = de.dropNode, p = de.point, t = de.target;
                if(!Ext.isArray(ns)){
                    ns = [ns];
                }
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeDropZone.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 expand has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            expand : function(deep, anim, callback, scope){
                if(this.loading){ // if an async load is already running, waiting til it's done
                    var timer;
                    var f = function(){
                        if(!this.loading){ // done loading
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/AsyncTreeNode.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 onClick has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            onClick : function(e){
                if(this.dropping){
                    e.stopEvent();
                    return;
                }
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeNodeUI.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 renderElements has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            renderElements : function(n, a, targetNode, bulkRender){
                // add some indent caching, this helps performance when rendering a large tree
                this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
        
                var cb = Ext.isBoolean(a.checked),
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeNodeUI.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 doPreload has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            doPreload : function(node){
                if(node.attributes.children){
                    if(node.childNodes.length < 1){ // preloaded?
                        var cs = node.attributes.children;
                        node.beginUpdate();
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeLoader.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 embedSWF has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 1 hr 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 updateToolbar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              updateToolbar: function(){
          
                  if(this.readOnly){
                      return;
                  }
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/form/HtmlEditor.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 selectText has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              selectText : function(start, end){
                  var v = this.getRawValue();
                  var doFocus = false;
                  if(v.length > 0){
                      start = start === undefined ? 0 : start;
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/form/TextField.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 initEvents has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              initEvents : function(){
                  Ext.form.TextField.superclass.initEvents.call(this);
                  if(this.validationEvent == 'keyup'){
                      this.validationTask = new Ext.util.DelayedTask(this.validate, this);
                      this.mon(this.el, 'keyup', this.filterValidation, this);
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/form/TextField.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

          Severity
          Category
          Status
          Source
          Language