KatanaCode/blogit-admin

View on GitHub

Showing 11 of 11 total issues

File posts_controller_spec.rb has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'spec_helper'

describe Blogit::PostsController do

  before do
Severity: Minor
Found in spec/controllers/blogit/posts_controller_spec.rb - About 2 hrs to fix

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

          it "should ping all search engines in ping_search_engines config if array" do
            Blogit.configuration.ping_search_engines = search_engines = [:google, :bing]
            search_engines.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).returns(@pingr)
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 1 other location - About 25 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 363..368

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

    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

          it "should ping all search engines in ping_search_engines config if array" do
            Blogit.configuration.ping_search_engines = search_engines = [:google, :bing]
            search_engines.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).returns(@pingr)
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 1 other location - About 25 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 267..272

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

    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

            it "should ping all search engines in Pingr::SUPPORTED_SEARCH_ENGINES if config is true" do
              Blogit.configuration.ping_search_engines = true
              Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
                Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).returns(@pingr)
              end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 20 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 275..280
    spec/controllers/blogit/posts_controller_spec.rb on lines 371..376

    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

          it "should ping all search engines in Pingr::SUPPORTED_SEARCH_ENGINES if config is true" do
            Blogit.configuration.ping_search_engines = true
            Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).returns(@pingr)
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 20 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 175..180
    spec/controllers/blogit/posts_controller_spec.rb on lines 275..280

    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

          it "should ping all search engines in Pingr::SUPPORTED_SEARCH_ENGINES if config is true" do
            Blogit.configuration.ping_search_engines = true
            Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).returns(@pingr)
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 20 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 175..180
    spec/controllers/blogit/posts_controller_spec.rb on lines 371..376

    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

    describe Blogit::Parsers::HtmlParser do
      
      let(:parser) { Blogit::Parsers::TextileParser.new("<h2>Some textile</h2>\n<p>A paragraph</p>") }
      let(:desired_output) { "<h2>Some textile</h2>\n<p>A paragraph</p>" }
      
    Severity: Minor
    Found in spec/lib/blogit/parsers/html_parser_spec.rb and 1 other location - About 15 mins to fix
    spec/lib/blogit/parsers/textile_parser_spec.rb on lines 3..9

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

    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

            it "should not ping any search engines if ping_search_engines is false" do
              Blogit.configuration.ping_search_engines = false
              Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
                Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).never
              end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 15 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 283..288
    spec/controllers/blogit/posts_controller_spec.rb on lines 379..384

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

    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 Blogit::Parsers::TextileParser do
      
      let(:parser) { Blogit::Parsers::TextileParser.new("h2. Some textile\n\np. A paragraph") }
      let(:desired_output) { "<h2>Some textile</h2>\n<p>A paragraph</p>" }
      
    Severity: Minor
    Found in spec/lib/blogit/parsers/textile_parser_spec.rb and 1 other location - About 15 mins to fix
    spec/lib/blogit/parsers/html_parser_spec.rb on lines 3..9

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

    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

          it "should not ping any search engines if ping_search_engines is false" do
            Blogit.configuration.ping_search_engines = false
            Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).never
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 15 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 183..188
    spec/controllers/blogit/posts_controller_spec.rb on lines 379..384

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

    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

          it "should not ping any search engines if ping_search_engines is false" do
            Blogit.configuration.ping_search_engines = false
            Pingr::SUPPORTED_SEARCH_ENGINES.each do |search_engine|
              Pingr::Request.expects(:new).with(search_engine, controller.posts_url(format: :xml)).never
            end
    Severity: Minor
    Found in spec/controllers/blogit/posts_controller_spec.rb and 2 other locations - About 15 mins to fix
    spec/controllers/blogit/posts_controller_spec.rb on lines 183..188
    spec/controllers/blogit/posts_controller_spec.rb on lines 283..288

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

    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