fastladder/fastladder

View on GitHub

Showing 137 of 237 total issues

Method crawl has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def crawl(feed)
      response = nil
      result = {
        message: '',
        error: false,
Severity: Minor
Found in lib/fastladder/fastladder_crawler.rb - About 1 hr to fix

    Method crawl has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def crawl(feed)
          response = nil
          result = {
            message: '',
            error: false,
    Severity: Minor
    Found in lib/fastladder/crawler.rb - About 1 hr to fix

      Function load has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              fn.load = function(options, done){
                  var that = this;
                  var flow;
                  var with_pass = function(f){
                      return function(){flow.pass();};
      Severity: Minor
      Found in app/assets/javascripts/lib/ldr.js - About 1 hr to fix

        Function feed_page has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            feed_page: function(num){
                // 過去記事取得
                var sid = app.state.now_reading;
                if(!sid) return;
                var limit;
        Severity: Minor
        Found in app/assets/javascripts/lib/reader/commands.js - About 1 hr to fix

          Function show_folder has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              show_folder: function(){
                  Event.cancelNext("click");
                  var menu = FlatMenu.create_on(this, "right_container");
                  menu.show();
                  var write_menu = function(){
          Severity: Minor
          Found in app/assets/javascripts/lib/reader/commands.js - About 1 hr to fix

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

              Method export has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def export(format)
                  case format
                  when 'opml'
                    folders = {}
                    subs = subscriptions.includes(:folder).order("subscriptions.id")
              Severity: Minor
              Found in app/models/member.rb - About 1 hr to fix

                Function round_corner has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function round_corner(el){
                    el = _$(el);
                    var browser = new BrowserDetect;
                    if(browser.isFirefox){
                        setStyle(el, {"-moz-border-radius" : "5px"});
                Severity: Minor
                Found in app/assets/javascripts/lib/subscribe/subscribe.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if(feedlink.length && feedlink_checkbox.length){
                          Array.forEach(feedlink, function(el){
                              Array.some(feedlink_checkbox, function(checkbox) {
                                  if (el.value === checkbox.value) {
                                      return false;
                  Severity: Critical
                  Found in app/assets/javascripts/lib/subscribe/subscribe.js - About 1 hr to fix

                    Function set_public has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function set_public(flag){
                        if(progress) return;
                        var api = new LDR.API("/api/feed/set_public");
                        var selected = Subs.filter(function(sub){
                            return (sub.selected && sub["public"] != flag);
                    Severity: Minor
                    Found in app/assets/javascripts/lib/share/share.js - About 1 hr to fix

                      Function post has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          post: function(param,onload){
                              this.req = new _XMLHttpRequest;
                              var onload = onload || this.onload;
                              var oncomplete = this.onComplete;
                              if(typeof onload != "function"){
                      Severity: Minor
                      Found in app/assets/javascripts/lib/api.js - About 1 hr to fix

                        Method confirm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def confirm
                            feeds = []
                            # params[:url] is http:/example.com because of squeeze("/")
                            @url = url_from_path(:url)
                            FeedSearcher.search(@url).each do |feedlink|
                        Severity: Minor
                        Found in app/controllers/subscribe_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 subscribe_submit has a Cognitive Complexity of 11 (exceeds 5 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: Minor
                        Found in app/assets/javascripts/lib/subscribe/subscribe.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 subscribed has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def subscribed
                            feedlink = params[:feedlink]
                            sub_id = (params[:subscribe_id] || 0).to_i
                            sub = nil
                            if sub_id > 0
                        Severity: Minor
                        Found in app/controllers/api/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 create_item has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def create_item(options, member)
                            if options[:feedtitle]
                              feed = Feed.where(feedlink: options[:feedlink]).first
                              unless feed
                                description = options[:feeddescription] ? options[:feeddescription] : options[:feedtitle]
                        Severity: Minor
                        Found in app/controllers/rpc_controller.rb - About 1 hr to fix

                          Function open_group has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              open_group: function(){
                                  if(!this.pins.length) return;
                                  var queue = new LDR.Queue();
                                  var can_popup = false;
                                  var self = this;
                          Severity: Minor
                          Found in app/assets/javascripts/lib/models/pin.js - About 1 hr to fix

                            Method discover has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def discover
                                feeds = []
                                url = Addressable::URI.parse(params[:url])
                                FeedSearcher.search(url.normalize.to_s).each do |feedlink|
                                  feedlink = (url + feedlink).to_s
                            Severity: Minor
                            Found in app/controllers/api/feed_controller.rb - About 1 hr to fix

                              Function MakeUpdater has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function MakeUpdater(label){
                                  var hash = {};
                                  var updater = (label?label+"_":"") + "updater";
                                  var update  = (label?label+"_":"") + "update";
                                  function get_func(label){
                              Severity: Minor
                              Found in app/assets/javascripts/lib/utils/common.js - About 1 hr to fix

                                Function setup_hotkey has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    LDR.setup_hotkey = function(){
                                        Keybind = new HotKey(null, "reader");
                                        Keybind.globalCallback = function(){
                                            app.state.LastUserAction = new Date;
                                            if(app.state.show_error) hide_error();
                                Severity: Minor
                                Found in app/assets/javascripts/lib/reader/hotkey_manager.js - About 1 hr to fix

                                  Function print_discover has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function print_discover(list){
                                      var output = _$("discover_items");
                                      var sub   = Template.get("discover_select_sub").compile()
                                      var unsub = Template.get("discover_select_unsub").compile()
                                      if(list.length == 0){
                                  Severity: Minor
                                  Found in app/assets/javascripts/lib/reader/main.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language