metanorma/metanorma-standoc

View on GitHub

Showing 88 of 88 total issues

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

    class FootnoteBlockInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :footnoteblock
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_note.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 3..11
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 17..26
lib/metanorma/standoc/macros_terms.rb on lines 30..39
lib/metanorma/standoc/macros_terms.rb on lines 43..52
lib/metanorma/standoc/macros_terms.rb on lines 56..65

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

    class AdmittedTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :admitted
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_terms.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 3..11
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_note.rb on lines 29..37
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 17..26
lib/metanorma/standoc/macros_terms.rb on lines 43..52
lib/metanorma/standoc/macros_terms.rb on lines 56..65

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

    class DeprecatedTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :deprecated
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_terms.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 3..11
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_note.rb on lines 29..37
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 17..26
lib/metanorma/standoc/macros_terms.rb on lines 30..39
lib/metanorma/standoc/macros_terms.rb on lines 56..65

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

    class AltTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :alt
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_terms.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 3..11
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_note.rb on lines 29..37
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 30..39
lib/metanorma/standoc/macros_terms.rb on lines 43..52
lib/metanorma/standoc/macros_terms.rb on lines 56..65

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

    class InheritInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :inherit
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_inline.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_note.rb on lines 29..37
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 17..26
lib/metanorma/standoc/macros_terms.rb on lines 30..39
lib/metanorma/standoc/macros_terms.rb on lines 43..52
lib/metanorma/standoc/macros_terms.rb on lines 56..65

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

    class DomainTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl
      named :domain
      parse_content_as :text
      using_format :short
Severity: Major
Found in lib/metanorma/standoc/macros_terms.rb and 8 other locations - About 20 mins to fix
lib/metanorma/standoc/macros_inline.rb on lines 3..11
lib/metanorma/standoc/macros_inline.rb on lines 130..138
lib/metanorma/standoc/macros_inline.rb on lines 142..150
lib/metanorma/standoc/macros_note.rb on lines 29..37
lib/metanorma/standoc/macros_terms.rb on lines 5..13
lib/metanorma/standoc/macros_terms.rb on lines 17..26
lib/metanorma/standoc/macros_terms.rb on lines 30..39
lib/metanorma/standoc/macros_terms.rb on lines 43..52

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

        noko do |xml|
          xml.ul **ul_attrs(node) do |xml_ul|
            list_caption(node, xml_ul)
            node.items.each { |item| ul_li(xml_ul, item) }
          end
Severity: Minor
Found in lib/metanorma/standoc/lists.rb and 1 other location - About 15 mins to fix
lib/metanorma/standoc/lists.rb on lines 65..70

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

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

        noko do |xml|
          xml.ol **ol_attrs(node) do |xml_ol|
            list_caption(node, xml_ol)
            node.items.each { |item| li(xml_ol, item) }
          end
Severity: Minor
Found in lib/metanorma/standoc/lists.rb and 1 other location - About 15 mins to fix
lib/metanorma/standoc/lists.rb on lines 39..44

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