ManaManaFramework/manamana

View on GitHub

Showing 36 of 36 total issues

Method translate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def translate(requirement)
        spec = ""
        spec << "  describe %Q%#{ requirement }% do\n"
        spec << "    before do\n"

Severity: Minor
Found in lib/manamana/tdsl/nodes.rb - About 1 hr to fix

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

    self._lexer_trans_targs = [
        23, 2, 27, 6, 26, 9, 4, 5, 
        3, 10, 28, 1, 13, 0, 29, 23, 
        15, 33, 20, 31, 17, 14, 18, 32, 
        19, 23, 22, 34, 23, 24, 12, 23, 
    Severity: Minor
    Found in lib/manamana/rdsl/lexer.rb and 1 other location - About 55 mins to fix
    lib/manamana/rdsl/lexer.rb on lines 150..157

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

    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

    self._lexer_trans_actions = [
        17, 0, 3, 0, 3, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 3, 15, 
        0, 3, 0, 3, 0, 0, 0, 3, 
        0, 19, 0, 24, 5, 3, 0, 13, 
    Severity: Minor
    Found in lib/manamana/rdsl/lexer.rb and 1 other location - About 55 mins to fix
    lib/manamana/rdsl/lexer.rb on lines 137..144

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

    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 deeply nested control flow statements.
    Open

                case _lexer_actions[_acts - 1]
    when 2 then
    # line 1 "NONE"
            begin
    te = p+1
    Severity: Major
    Found in lib/manamana/tdsl/lexer.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  case _lexer_actions[_acts - 1]
      when 3 then
      # line 1 "NONE"
              begin
      te = p+1
      Severity: Major
      Found in lib/manamana/rdsl/lexer.rb - About 45 mins to fix

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

        self._lexer_range_lengths = [
            0, 4, 4, 4, 4, 0, 0, 0, 
            0, 0, 0, 0, 0, 3, 4, 4, 
            0, 0, 0, 0, 0, 0, 1, 5, 
            1, 0, 1, 0, 0, 1, 0, 1, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 175..181
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_to_state_actions = [
            0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0, 0, 0, 21, 
            0, 0, 0, 0, 0, 0, 0, 0, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 175..181
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_single_lengths = [
            0, 7, 5, 6, 4, 2, 1, 1, 
            1, 1, 1, 1, 1, 1, 7, 5, 
            1, 1, 1, 2, 1, 1, 1, 4, 
            3, 4, 2, 2, 1, 3, 4, 2, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 175..181
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_key_offsets = [
            0, 0, 15, 28, 42, 54, 56, 57, 
            58, 59, 60, 61, 62, 63, 70, 85, 
            98, 99, 100, 101, 103, 104, 105, 108, 
            122, 127, 131, 135, 137, 138, 143, 147, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 175..181
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_index_offsets = [
            0, 0, 12, 22, 33, 42, 45, 47, 
            49, 51, 53, 55, 57, 59, 64, 76, 
            86, 88, 90, 92, 95, 97, 99, 102, 
            112, 117, 122, 126, 129, 131, 136, 141, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 175..181
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_from_state_actions = [
            0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0, 0, 0, 1, 
            0, 0, 0, 0, 0, 0, 0, 0, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 187..193

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

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

        self._lexer_eof_trans = [
            0, 1, 1, 1, 1, 1, 1, 1, 
            1, 1, 1, 1, 0, 0, 16, 16, 
            16, 16, 16, 16, 16, 16, 26, 0, 
            32, 32, 32, 32, 37, 38, 38, 38, 
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb and 6 other locations - About 40 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 35..41
        lib/manamana/rdsl/lexer.rb on lines 74..80
        lib/manamana/rdsl/lexer.rb on lines 86..92
        lib/manamana/rdsl/lexer.rb on lines 98..104
        lib/manamana/rdsl/lexer.rb on lines 163..169
        lib/manamana/rdsl/lexer.rb on lines 175..181

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

        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

        Method recursive_require has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def recursive_require(in_dir)
              Dir.entries(in_dir).each do |entry|
                next if ['.', '..'].include? entry
        
                path = File.join(in_dir, entry)
        Severity: Minor
        Found in lib/manamana/runner.rb - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method load_files has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def load_files(in_dir, lines = '')
              Dir.entries(in_dir).each do |entry|
                next if ['.', '..'].include? entry
        
                path = File.join(in_dir, entry)
        Severity: Minor
        Found in lib/manamana/compiler.rb - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            -1,   -24,    -2,    -3,   -24,    -4,    -5,    -6,    -9,   -17,
            27,    -7,    -8,   -10,   -11,   -13,   -14,   -19,   -24,   -18,
           -12,   -15,   -20,   -22,   -16,   -21,   -23 ]
        Severity: Minor
        Found in lib/manamana/rdsl/parser.rb and 1 other location - About 20 mins to fix
        lib/manamana/rdsl/lexer.rb on lines 25..28

        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

            0, 1, 2, 1, 3, 1, 5, 1, 
            6, 1, 7, 1, 8, 1, 9, 1, 
            10, 1, 11, 1, 12, 2, 0, 1, 
            2, 3, 4
        Severity: Minor
        Found in lib/manamana/rdsl/lexer.rb and 1 other location - About 20 mins to fix
        lib/manamana/rdsl/parser.rb on lines 43..45

        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

        Severity
        Category
        Status
        Source
        Language