weirdpercent/oversetter

View on GitHub

Showing 8 of 16 total issues

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

    blaa.command :tr do |translate|
        translate.flag :src, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        translate.flag :tar, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        translate.action do |global_options, options, args|
            if args.length > 1
Severity: Major
Found in lib/oversetter/cli/hablaa.rb and 2 other locations - About 1 hr to fix
lib/oversetter/cli/hablaa.rb on lines 31..42
lib/oversetter/cli/hablaa.rb on lines 47..58

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

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

    blaa.command :si do |similar|
        similar.flag :ssrc, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        similar.flag :star, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        similar.action do |global_options, options, args|
            if args.length > 1
Severity: Major
Found in lib/oversetter/cli/hablaa.rb and 2 other locations - About 1 hr to fix
lib/oversetter/cli/hablaa.rb on lines 15..26
lib/oversetter/cli/hablaa.rb on lines 31..42

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

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

    blaa.command :ex do |example|
        example.flag :esrc, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        example.flag :etar, :default_value => nil, :arg_name => 'string', :desc => '3-letter ISO 693-3 source language code (Required)'
        example.action do |global_options, options, args|
            if args.length > 1
Severity: Major
Found in lib/oversetter/cli/hablaa.rb and 2 other locations - About 1 hr to fix
lib/oversetter/cli/hablaa.rb on lines 15..26
lib/oversetter/cli/hablaa.rb on lines 47..58

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

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

      if $fmt == :json
        fo = File.open(outfile, 'w+')
        fo.print MultiJson.dump($tofile, :pretty => true)
        fo.close
        puts Rainbow("Word search was written to #{outfile}.").bright
Severity: Major
Found in lib/oversetter.rb and 2 other locations - About 1 hr to fix
lib/oversetter.rb on lines 129..142
lib/oversetter.rb on lines 148..161

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

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

      if $fmt == :json
        fo = File.new(outfile, 'w+')
        fo.print MultiJson.dump($tofile, :pretty => true)
        fo.close
        puts Rainbow("Word search was written to #{outfile}.").bright
Severity: Major
Found in lib/oversetter.rb and 2 other locations - About 1 hr to fix
lib/oversetter.rb on lines 148..161
lib/oversetter.rb on lines 166..179

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

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

        if $fmt == :json
          fo = File.new(outfile, 'w+')
          fo.print MultiJson.dump($tofile, :pretty => true)
          fo.close
          puts Rainbow("Word search was written to #{outfile}.").bright
Severity: Major
Found in lib/oversetter.rb and 2 other locations - About 1 hr to fix
lib/oversetter.rb on lines 129..142
lib/oversetter.rb on lines 166..179

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

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

                    if pos['code'] != nil
                        print Rainbow('POS code|').bright
                        print "#{pos['code']}|"
                        pc = { 'pos code' => pos['code'] }
                        Oversetter.tofile(pc)
Severity: Minor
Found in lib/oversetter/hablaa/translate.rb and 1 other location - About 20 mins to fix
lib/oversetter/hablaa/translate.rb on lines 40..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 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

                    if pos['title'] != nil
                        print Rainbow('Part of speech|').bright
                        print "#{pos['title']}|"
                        pt = { 'pos title' => pos['title']}
                        Oversetter.tofile(pt)
Severity: Minor
Found in lib/oversetter/hablaa/translate.rb and 1 other location - About 20 mins to fix
lib/oversetter/hablaa/translate.rb on lines 34..38

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

Severity
Category
Status
Source
Language