fastladder/fastladder

View on GitHub

Showing 137 of 237 total issues

Function initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initialize: function(name,value,config){
        var tv = TreeView;
        tv.count++;
        tv.instance["treeview_" + tv.count ] = this;
        var self = this;
Severity: Minor
Found in app/assets/javascripts/lib/reader/folder.js - About 1 hr to fix

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

    Control.instant_clip = function(){
        var item = get_active_item(true);
        if(!item) return;
        // copy rate
        var rate = subs_item(get_active_feed().subscribe_id).rate;
    Severity: Minor
    Found in app/assets/javascripts/lib/reader/addon.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 toRelativeDate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    Number.prototype.toRelativeDate = function(){
      var k = this > 0 ? this : -this;
      var u = "second";
      var vec = this >= 0 ? "ago" : "after";
      var st = 0;
    Severity: Minor
    Found in app/assets/javascripts/lib/reader/addon.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 MakeUpdater has a Cognitive Complexity of 10 (exceeds 5 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

    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 getValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    Form.getValue = function(el){
        return (
            (/text|hidden|submit/.test(el.type)) ? el.value :
            (el.type == "checkbox" && el.checked) ? el.value :
            (el.type == "radio"    && el.checked) ? el.value :
    Severity: Minor
    Found in app/assets/javascripts/lib/utils/common.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 export has a Cognitive Complexity of 10 (exceeds 5 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

    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 proxy= has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def proxy=(uri = nil)
          return if uri.blank?
          case uri
          when URI
            @http_proxy = uri
    Severity: Minor
    Found in lib/fastladder.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 fetch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def fetch
        @folders = Hash.new do |hash, key|
          hash[key] = []
        end
        @opml ||= begin
    Severity: Minor
    Found in app/controllers/import_controller.rb - About 1 hr to fix

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

        Method subscribe_feed has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def subscribe_feed(feedlink, options = {})
            if self.subscriptions.size >= Settings.subscribe_limit
              logger.warn "SUBSCRIBE LIMIT: #{self.username}(#{self.id}) #{feedlink}"
              return nil
            end
        Severity: Minor
        Found in app/models/member.rb - About 1 hr to fix

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

                  var write_menu = function(){
                      menu.clear();
                      // 開く件数
                      var open_num = app.config.max_pin;
                      // containerの高さにあわせて調整
          Severity: Minor
          Found in app/assets/javascripts/lib/reader/commands.js - About 1 hr to fix

            Function select has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                select : function(id){
                    if(this.folder_id == id){
                        this.folder_id = null;
                    } else {
                        this.folder_id = id;
            Severity: Minor
            Found in app/assets/javascripts/lib/reader/manage.js - About 1 hr to fix

              Function kc2char has 26 lines of code (exceeds 25 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 1 hr to fix

                Function get_unread has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 cumulativeOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  Position.cumulativeOffset = function(element) {
                    var valueT = 0, valueL = 0;
                    do {
                      valueT += element.offsetTop  || 0;
                      valueL += element.offsetLeft || 0;
                Severity: Minor
                Found in app/assets/javascripts/lib/utils/common.js - About 55 mins 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 count_items has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def count_items(options = {})
                    subscriptions = @member.subscriptions
                    subscriptions = subscriptions.has_unread if options[:unread]
                    stored_on_list = subscriptions.order("id").map do |sub|
                      {
                Severity: Minor
                Found in app/controllers/api_controller.rb - About 55 mins 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 update_or_insert_items_to_feed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def update_or_insert_items_to_feed(feed, items, result)
                      items.reverse_each do |item|
                        if old_item = feed.items.find_by(guid: item.guid)
                          old_item.increment(:version)
                          unless almost_same(old_item.title, item.title) and almost_same((old_item.body || "").html2text, (item.body || "").html2text)
                Severity: Minor
                Found in lib/fastladder/crawler.rb - About 55 mins 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 subscribe has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def subscribe
                    feedlink = params[:feedlink]
                    options = {
                      folder_id: 0,
                      rate: 0,
                Severity: Minor
                Found in app/controllers/api/feed_controller.rb - About 55 mins 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 post has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 update_or_insert_items_to_feed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def update_or_insert_items_to_feed(feed, items, result)
                      items.reverse_each do |item|
                        if old_item = feed.items.find_by(guid: item.guid)
                          old_item.increment(:version)
                          unless almost_same(old_item.title, item.title) and almost_same((old_item.body || "").html2text, (item.body || "").html2text)
                Severity: Minor
                Found in lib/fastladder/fastladder_crawler.rb - About 55 mins 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