fastladder/fastladder

View on GitHub

Showing 137 of 237 total issues

File common.js has 1211 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function has_attr(id){
    return function(target){
        return this.getAttribute(id)
    }
}
Severity: Major
Found in app/assets/javascripts/lib/utils/common.js - About 3 days to fix

    File main.js has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    window.onload   = init;
    window.onresize = function(){LDR.invoke_hook('WINDOW_RESIZE')};
    
    var app = LDR.Application.getInstance();
    
    
    Severity: Major
    Found in app/assets/javascripts/lib/reader/main.js - About 2 days to fix

      File commands.js has 984 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      function touch(id, state){
          if(app.config.touch_when == state){
              touch_all(id)
          }
      }
      Severity: Major
      Found in app/assets/javascripts/lib/reader/commands.js - About 2 days to fix

        File addon.js has 910 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // print_ads
        LDR.register_hook('BEFORE_PRINTFEED', function(feed){
            print_ads(feed.ads);
        });
        
        
        Severity: Major
        Found in app/assets/javascripts/lib/reader/addon.js - About 2 days to fix

          Control has 76 functions (exceeds 20 allowed). Consider refactoring.
          Open

          var Control = {
              pin: function(){
                  var item = get_active_item(true);
                  if(!item) return;
                  toggle_pin(item.item_id);
          Severity: Major
          Found in app/assets/javascripts/lib/reader/commands.js - About 1 day to fix

            File manage.js has 599 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            // manage
            
            updater("manage_item", function(){
                if(!Manage.Item.loaded){
            Severity: Major
            Found in app/assets/javascripts/lib/reader/manage.js - About 1 day to fix

              File subscribe.js has 476 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* LDR /subscribe/ */
              
              ApiKey = document.querySelector('#ApiKey').dataset.apiKey;
              LDR.API.StickyQuery = { ApiKey: ApiKey };
              var LDReader = {};
              Severity: Minor
              Found in app/assets/javascripts/lib/subscribe/subscribe.js - About 7 hrs to fix

                File share.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                window.onload = init;
                LDR.API.StickyQuery = { ApiKey: ApiKey };
                
                var State = {};
                State.offset = 0;
                Severity: Minor
                Found in app/assets/javascripts/lib/share/share.js - About 4 hrs to fix

                  File subscriber.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*************************************************
                     購読リストの整形。Subsの絞込みや、整形
                   *************************************************/
                  Subscribe = {};
                  // Template
                  Severity: Minor
                  Found in app/assets/javascripts/lib/reader/subscriber.js - About 4 hrs to fix

                    Function print_feed has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function print_feed(feed){
                        LDR.invoke_hook('BEFORE_PRINTFEED', feed);
                        var subscribe_id = feed.subscribe_id;
                    
                        app.state.last_feed = feed;
                    Severity: Major
                    Found in app/assets/javascripts/lib/reader/commands.js - About 4 hrs to fix

                      Function print_feed has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function print_feed(feed){
                          LDR.invoke_hook('BEFORE_PRINTFEED', feed);
                          var subscribe_id = feed.subscribe_id;
                      
                          app.state.last_feed = feed;
                      Severity: Minor
                      Found in app/assets/javascripts/lib/reader/commands.js - About 3 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 update has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                      Open

                          update: function(reload_flag){
                              if(!LDR.VARS.USE_PARTIAL_LOAD){
                                  return this._update.apply(this, arguments);
                              }
                              var self = this;
                      Severity: Minor
                      Found in app/assets/javascripts/lib/reader/main.js - About 3 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

                      Method subs has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def subs
                          limit = (params[:limit] || 0).to_i
                          from_id = (params[:from_id] || 0).to_i
                          items = []
                          subscriptions = @member.subscriptions
                      Severity: Minor
                      Found in app/controllers/api_controller.rb - About 3 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 queryCSS has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function queryCSS(el,rule){
                          var tokens = rule.split(' ');
                          var checkFunctions = [];
                          function cmp(a,b){
                              return (""+a).toLowerCase() == (""+b).toLowerCase();
                      Severity: Major
                      Found in app/assets/javascripts/lib/events/queryCSS.js - About 3 hrs to fix

                        Function update has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            update: function(reload_flag){
                                if(!LDR.VARS.USE_PARTIAL_LOAD){
                                    return this._update.apply(this, arguments);
                                }
                                var self = this;
                        Severity: Major
                        Found in app/assets/javascripts/lib/reader/main.js - About 3 hrs to fix

                          Function toRegExp has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                              toRegExp: function(text){
                                  text = text || this.source;
                                  var nstr = [];
                                  var temp,kana,hira,kata;
                                  var skip = 0;
                          Severity: Minor
                          Found in app/assets/javascripts/lib/utils/roma.js - About 3 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 get_active_item has a Cognitive Complexity of 23 (exceeds 5 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: Minor
                          Found in app/assets/javascripts/lib/reader/commands.js - About 3 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

                          `` has 27 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          ListView.extend({
                              element_id: "listview_items",
                              element_class: "listview",
                              get_item_by_id: function(id){
                                  if(this.item_index[id]){
                          Severity: Minor
                          Found in app/assets/javascripts/lib/reader/addon.js - About 3 hrs to fix

                            Function kc2char has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HotKey.kc2char = function(kc){
                                var between = function(a,b){
                                    return a <= kc && kc <= b
                                }
                                var _32_40 = "space pageup pagedown end home left up right down".split(" ");
                            Severity: Minor
                            Found in app/assets/javascripts/lib/events/hotkey.js - About 3 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 setup_hook has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                LDR.setup_hook = function(){
                                    var guide_fix = function(){
                                        if(!hasClass("right_container","mode-guide")) return;
                                        if(browser.isIE){
                                            if(!_$("guiderankbody")) return;
                            Severity: Major
                            Found in app/assets/javascripts/lib/reader/event_trigger.js - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language