fastladder/fastladder

View on GitHub

Showing 137 of 237 total issues

Function Set has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Set(a){
    if(a.isSet) return a;
    var self;
    var index = {};
    self = [];
Severity: Major
Found in app/assets/javascripts/lib/reader/addon.js - About 3 hrs to fix

    Function setup_event has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function setup_event(){
        // Subscribe_idに対応するイベント
        ClickEvent.add('[subscribe_id]', function(){
            var action = get_action(this);
            var sid = this.getAttribute("subscribe_id");
    Severity: Major
    Found in app/assets/javascripts/lib/reader/view.js - About 2 hrs to fix

      Function toggle_clip has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function toggle_clip(id){
          var body = _$("item_body_"+id);
          var param = get_item_info(id);
          var rate = subs_item(get_active_feed().subscribe_id).rate;
          function fetch_clip(url,callback){
      Severity: Major
      Found in app/assets/javascripts/lib/reader/addon.js - About 2 hrs to fix

        Function init has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function init(){
            app.load({}, function(){
                LDR.setup_hook();
                LDR.invoke_hook('BEFORE_INIT');
                window.onerror = function(a,b,c){
        Severity: Major
        Found in app/assets/javascripts/lib/reader/main.js - About 2 hrs to fix

          Function subs_edit has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function subs_edit(e){
              var el = this;
              if(e){
                  Event.stop(e);
              }
          Severity: Major
          Found in app/assets/javascripts/lib/subscribe/subscribe.js - About 2 hrs to fix

            Model has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            Subscribe.Model = Class.create().extend({
                initialize: function(){
                    this.loaded = false;
                    return this;
                },
            Severity: Minor
            Found in app/assets/javascripts/lib/reader/subscriber.js - About 2 hrs to fix

              Function make_filter has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function make_filter(){
                  var filters = [];
                  function add_filter(f){
                      filters.push(f);
                  }
              Severity: Major
              Found in app/assets/javascripts/lib/share/share.js - About 2 hrs to fix

                Function setup_widgets has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function setup_widgets(){
                    channel_widgets.sep = "  |  "
                    entry_widgets.sep = "";
                
                    entry_widgets.add('created_on', function(feed, item){
                Severity: Major
                Found in app/assets/javascripts/lib/reader/widgets_en.js - About 2 hrs to fix

                  Method fetch_favicon! has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def fetch_favicon!
                      self.favicon ||= Favicon.new(feed: self)
                      favicon_list.each do |uri|
                        next unless response = URI.open(uri.to_s) rescue nil # ensure timeout
                        next if response.status.last.to_i >= 400
                  Severity: Minor
                  Found in app/models/feed.rb - About 2 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

                  Function init has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                  HotKey.prototype.init = function(){
                      var self = this;
                      var target = this._target;
                      var cancelNext;
                      var state = "";
                  Severity: Minor
                  Found in app/assets/javascripts/lib/events/hotkey.js - About 2 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

                  Function subscribe_submit has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function subscribe_submit(e){
                      if(!this.history_back.checked) return;
                  
                      var form = this;
                      var folder_id = this.folder_id.value;
                  Severity: Major
                  Found in app/assets/javascripts/lib/subscribe/subscribe.js - About 2 hrs to fix

                    Class Member has 21 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Member < ActiveRecord::Base
                      # Virtual attribute for the unencrypted password
                      attr_accessor :password
                      serialize :config_dump
                    
                    
                    Severity: Minor
                    Found in app/models/member.rb - About 2 hrs to fix

                      Function get_active_item has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function get_active_item(detail){
                          // return 1;
                          var sc = _$("right_container").scrollTop;
                          var divs = _$("right_body").getElementsByTagName("h2");
                          // for Opera9 beta
                      Severity: Major
                      Found in app/assets/javascripts/lib/reader/commands.js - About 2 hrs to fix

                        Function setup_widgets has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function setup_widgets(){
                            channel_widgets.sep = "&nbsp;&nbsp;|&nbsp;&nbsp;"
                            entry_widgets.sep = "";
                        
                            entry_widgets.add('created_on', function(feed, item){
                        Severity: Minor
                        Found in app/assets/javascripts/lib/reader/widgets.js - About 1 hr to fix

                          Function Config has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              LDR.Config = (function(){
                                  function Config(){
                                      Object.extend(this, LDR.DefaultConfig);
                                      this.onConfigChange = {};
                                  }
                          Severity: Minor
                          Found in app/assets/javascripts/lib/models/config.js - About 1 hr to fix

                            Function pin_hover has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                pin_hover: function(e){
                                    function stophide(){
                                        if(app.state.pin_timer){ app.state.pin_timer.cancel() }
                                    }
                                    stophide();
                            Severity: Minor
                            Found in app/assets/javascripts/lib/reader/commands.js - About 1 hr to fix

                              Function Application has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  this.Application = (function(done){
                                      function Application() {
                                          this.initialized = false;
                                          this.style_initializer = new LDR.StyleInitializer;
                                          this.state  = new LDR.StateClass;
                              Severity: Minor
                              Found in app/assets/javascripts/lib/ldr.js - About 1 hr to fix

                                Function toX has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    toX: function(text,to){
                                        var nstr = [];
                                        var temp,kana;
                                        var skip = 0;
                                        var latin = /[a-zA-Z.,-]/;
                                Severity: Minor
                                Found in app/assets/javascripts/lib/utils/roma.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 StyleInitializer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    LDR.StyleInitializer = (function(){
                                        function StyleInitializer(){
                                            var that = this;
                                            // self override
                                            that.addRule = function(){
                                Severity: Minor
                                Found in app/assets/javascripts/lib/reader/style_initializer.js - About 1 hr to fix

                                  Function get_unread has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function get_unread(id,callback){
                                      app.state.viewrange.start = 0;
                                      app.state.has_next = true;
                                      var api_url = '/api/unread';
                                      function has_cache(){
                                  Severity: Minor
                                  Found in app/assets/javascripts/lib/reader/main.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language