fastladder/fastladder

View on GitHub
app/assets/javascripts/lib/reader/subscriber.js

Summary

Maintainability
D
1 day
Test Coverage

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

    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_domain_names has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          make_domain_names: function(){
              function get_domain(url){
                  var start = url.indexOf('//') + 2;
                  var end   = url.indexOf('/', start);
                  if(end == -1) end = url.length;
      Severity: Minor
      Found in app/assets/javascripts/lib/reader/subscriber.js - About 1 hr to fix

        Function domain has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            domain: function(model){
                var folder_names = model.get_domain_names();
                var root_items = {list:[]};
                var folders = [];
                folder_names.forEach(function(v){
        Severity: Minor
        Found in app/assets/javascripts/lib/reader/subscriber.js - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  if(app.config.show_all){
                      return subscribers.pluck("element").toDF()
                  } else {
                      return subscribers.filter(
                          function(v){ return v.param.unread_count > 0 }
          Severity: Major
          Found in app/assets/javascripts/lib/reader/subscriber.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/lib/reader/subscriber.js on lines 287..293

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 84.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  if(app.config.show_all){
                      return rates.pluck("element").toDF()
                  } else {
                      return rates.filter(
                          function(v){ return v.param.feed_count > 0 }
          Severity: Major
          Found in app/assets/javascripts/lib/reader/subscriber.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/lib/reader/subscriber.js on lines 313..319

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 84.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status