spec/models/legislation/annotation_spec.rb

Summary

Maintainability
A
1 hr
Test Coverage

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

  it "calculates the context for multinode annotations" do
    quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam"\
            " erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex"\
            " ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum"\
            " dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril"\
Severity: Minor
Found in spec/models/legislation/annotation_spec.rb and 1 other location - About 30 mins to fix
spec/models/legislation/annotation_spec.rb on lines 44..63

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

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

  it "calculates the context for multinode annotations 2" do
    quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla"\
            " facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore"\
            " te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant"\
            " aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo"
Severity: Minor
Found in spec/models/legislation/annotation_spec.rb and 1 other location - About 30 mins to fix
spec/models/legislation/annotation_spec.rb on lines 12..41

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

Line is too long. [134/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nExpetenda tincidunt in sed, ex"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id.\n\nHis audiam</span>deserunt in, eum"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum"\

Line is too long. [135/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            "Expetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi"\

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    context = "Lorem <span class=annotator-hl>ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt"\

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\

Line is too long. [120/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " works. <span class=annotator-hl>By contrast, our General Public Licenses are intended to guarantee your freedom to share"\

Line is too long. [120/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo"

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " accessible server, gives the public access to the source code of the modified version.\r\n\r\nAn older license, called the"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of free software, we are referring to"\

Line is too long. [135/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut"\

Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " software for all its users.\r\n\r\nWhen we speak of free software, we are referring to freedom, not price. Our General"\

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " and change all versions of a program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of"\

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " source code becomes available to the community. It requires the operator of a network server to provide the source code of"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free"\

Line is too long. [134/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

            " te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " aliquip ex ea commodo consequat. <span class=annotator-hl>Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " legal permission to copy, distribute and/or modify the software.\r\n\r\nA secondary benefit of defending all users' freedom"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know"\

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\

Line is too long. [135/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " permits making a modified version and letting the public access it on a server without ever releasing its source code to the"\

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " to ensure cooperation with the community in the case of network server software.\r\n\r\nThe licenses for most software and"\

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " public.\r\n\r\nThe GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " aliquando ius ex. Ea aperiri sententiae duo</span>. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license,"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    body = "The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this"\

Line is too long. [139/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " of it in new free programs, and that you know you can do these things.\r\n\r\nDevelopers that use our General Public Licenses"\

Line is too long. [137/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " is that improvements made in alternate versions of the program, if they receive widespread use, become available for other"\

Line is too long. [132/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    quote = "By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a"\

Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have"\

Line is too long. [140/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim"\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

    context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna"\

Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

           " developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation."\

Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

              " the freedom to distribute copies of free software (and charge for them if you wish)</span>, that you receive source code"\

There are no issues that match your filters.

Category
Status