sarumaj/go-kakasi

View on GitHub
internal/properties/convert_tables.go

Summary

Maintainability
C
1 day
Test Coverage

Method convertTables.Latin1Table has 97 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (c convertTables) Latin1Table() map[rune]string {
    return map[rune]string{
        0x00A1: "!",        // inverted exclamation mark
        0x00A2: "cent",     // cent mark
        0x00A3: "GBP",      // pound mark
Severity: Major
Found in internal/properties/convert_tables.go - About 2 hrs to fix

    Method convertTables.CyrillicTable has 84 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (convertTables) CyrillicTable() map[rune]string {
        return map[rune]string{
            0x0400: "E",   // Ѐ
            0x0401: "E",   // Ё
            0x0402: "Dj",  // Ђ
    Severity: Major
    Found in internal/properties/convert_tables.go - About 2 hrs to fix

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

      func (c convertTables) AlphaTable1() map[rune]string {
          return map[rune]string{
              ' ':  "\u3000",
              '!':  "\uFF01",
              '"':  "\uFF02",
      Severity: Major
      Found in internal/properties/convert_tables.go and 1 other location - About 1 hr to fix
      internal/properties/convert_tables.go on lines 276..312

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

      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

      func (convertTables) SymbolTable1() map[rune]string {
          return map[rune]string{
              0x3000: " ",
              0x3001: ",",
              0x3002: ".",
      Severity: Major
      Found in internal/properties/convert_tables.go and 1 other location - About 1 hr to fix
      internal/properties/convert_tables.go on lines 14..50

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

      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

      func (convertTables) SymbolTable3() map[rune]string {
          return map[rune]string{
              0x0391: "Alpha",
              0x0392: "Beta",
              0x0393: "Gamma",
      Severity: Major
      Found in internal/properties/convert_tables.go and 1 other location - About 1 hr to fix
      internal/properties/convert_tables.go on lines 375..403

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

      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

      func (convertTables) SymbolTable4() map[rune]string {
          return map[rune]string{
              0x03B1: "alpha",
              0x03B2: "beta",
              0x03B3: "gamma",
      Severity: Major
      Found in internal/properties/convert_tables.go and 1 other location - About 1 hr to fix
      internal/properties/convert_tables.go on lines 342..370

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

      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

      There are no issues that match your filters.

      Category
      Status