Showing 122 of 122 total issues

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

    ContentNode: function(string, locInfo) {
      LocationInfo.call(this, locInfo);
      this.type = "content";
      this.string = string;
    },
Severity: Major
Found in vendor/assets/javascripts/handlebars.js and 3 other locations - About 35 mins to fix
vendor/assets/javascripts/handlebars.js on lines 671..675
vendor/assets/javascripts/handlebars.js on lines 720..724
vendor/assets/javascripts/handlebars.js on lines 749..753

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 46.

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

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

  config.action_mailer.smtp_settings = {
    :address              => ENV["SMTP_ADDRESS"],
    :port                 => ENV["SMTP_PORT"],
    :domain               => ENV["LODGE_DOMAIN"],
    :user_name            => ENV["SMTP_USERNAME"],
Severity: Minor
Found in config/environments/development.rb and 1 other location - About 30 mins to fix
config/environments/production.rb on lines 95..102

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 33.

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

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

  config.action_mailer.smtp_settings = {
    :address              => ENV["SMTP_ADDRESS"],
    :port                 => ENV["SMTP_PORT"],
    :domain               => ENV["LODGE_DOMAIN"],
    :user_name            => ENV["SMTP_USERNAME"],
Severity: Minor
Found in config/environments/production.rb and 1 other location - About 30 mins to fix
config/environments/development.rb on lines 64..71

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 33.

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

Avoid too many return statements within this function.
Open

  case 23:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 32;
Severity: Major
Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return false;
    Severity: Major
    Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        case 22:this.popState(); return 18;
      Severity: Major
      Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          case 24:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 32;
        Severity: Major
        Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return fn(context);
          Severity: Major
          Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return true;
            Severity: Major
            Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                            return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                                    {text: "", token: null, line: this.yylineno});
              Severity: Major
              Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  case 21:this.popState(); return 24;
                Severity: Major
                Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    case 30:yy_.yytext = strip(1,2); return 40;
                  Severity: Major
                  Found in vendor/assets/javascripts/handlebars.js - About 30 mins to fix

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

                      describe 'stock' do
                        subject { post :stock, id: new_article.id, format: :js }
                        let(:stockes_count) { 1 }
                    
                        it '' do
                    Severity: Minor
                    Found in spec/controllers/articles_controller_spec.rb and 1 other location - About 25 mins to fix
                    spec/controllers/articles_controller_spec.rb on lines 199..205

                    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 31.

                    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

                      describe 'unstock' do
                        subject { post :unstock, id: stocked_article.id, format: :js }
                        let(:stockes_count) { 0 }
                    
                        it '' do
                    Severity: Minor
                    Found in spec/controllers/articles_controller_spec.rb and 1 other location - About 25 mins to fix
                    spec/controllers/articles_controller_spec.rb on lines 189..195

                    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 31.

                    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 3 locations. Consider refactoring.
                    Open

                    RSpec.describe StockNotification, :type => :model do
                      it { should belong_to(:user) }
                      it { should belong_to(:article) }
                      it { should have_many(:notification_targets) }
                      it { should have_many(:targets) }
                    Severity: Minor
                    Found in spec/models/stock_notification_spec.rb and 2 other locations - About 20 mins to fix
                    spec/models/article_notification_spec.rb on lines 3..7
                    spec/models/comment_notification_spec.rb on lines 3..7

                    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 28.

                    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 3 locations. Consider refactoring.
                    Open

                    RSpec.describe ArticleNotification, :type => :model do
                      it { should belong_to(:user) }
                      it { should belong_to(:article) }
                      it { should have_many(:notification_targets) }
                      it { should have_many(:targets) }
                    Severity: Minor
                    Found in spec/models/article_notification_spec.rb and 2 other locations - About 20 mins to fix
                    spec/models/comment_notification_spec.rb on lines 3..7
                    spec/models/stock_notification_spec.rb on lines 3..7

                    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 28.

                    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 3 locations. Consider refactoring.
                    Open

                    RSpec.describe CommentNotification, :type => :model do
                      it { should belong_to(:user) }
                      it { should belong_to(:article) }
                      it { should have_many(:notification_targets) }
                      it { should have_many(:targets) }
                    Severity: Minor
                    Found in spec/models/comment_notification_spec.rb and 2 other locations - About 20 mins to fix
                    spec/models/article_notification_spec.rb on lines 3..7
                    spec/models/stock_notification_spec.rb on lines 3..7

                    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 28.

                    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

                      def up
                        sql = 'SELECT tag_id, user_id, created_at FROM following_tags'
                        for tag in execute(sql)
                          execute("INSERT INTO taggings (tag_id, taggable_id, taggable_type, context, created_at) VALUES(#{tag['tag_id']}, #{tag['user_id']}, 'User', 'following_tags', '#{tag['created_at']}')")
                        end
                    Severity: Minor
                    Found in db/migrate/20140723002446_migrate_following_tags_to_tagging.rb and 1 other location - About 20 mins to fix
                    db/migrate/20140723002446_migrate_following_tags_to_tagging.rb on lines 9..14

                    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 27.

                    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

                      def down
                        sql = "SELECT tag_id, taggable_id, created_at FROM taggings WHERE  taggable_type = 'User' AND context = 'following_tags'"
                        for tagging in execute(sql)
                          execute("INSERT INTO following_tags (user_id, tag_id, created_at) VALUES(#{tagging['taggable_id']}, #{tagging['tag_id']}, '#{tagging['created_at']}')")
                        end
                    Severity: Minor
                    Found in db/migrate/20140723002446_migrate_following_tags_to_tagging.rb and 1 other location - About 20 mins to fix
                    db/migrate/20140723002446_migrate_following_tags_to_tagging.rb on lines 2..7

                    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 27.

                    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 3 locations. Consider refactoring.
                    Open

                      describe 'draft' do
                        subject { get :draft }
                        let(:result) { [drafting_article] }
                    
                        it '@articles is only drafting articles.' do
                    Severity: Minor
                    Found in spec/controllers/articles_controller_spec.rb and 2 other locations - About 15 mins to fix
                    spec/controllers/articles_controller_spec.rb on lines 30..36
                    spec/controllers/articles_controller_spec.rb on lines 50..56

                    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 25.

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language