tikidunpon/SwiftMoji

View on GitHub

Showing 22 of 22 total issues

SwiftMojiTests has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

class SwiftMojiTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
    }
Severity: Minor
Found in Example/Tests/SwiftMojiTests.swift - About 3 hrs to fix

    File SwiftMojiTests.swift has 253 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import XCTest
    
    @testable import SwiftMoji
    
    class SwiftMojiTests: XCTestCase {
    Severity: Minor
    Found in Example/Tests/SwiftMojiTests.swift - About 2 hrs to fix

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

          func testIsLowerCamelized() {
              XCTAssertTrue("userId".isLowerCamelized())
              XCTAssertTrue("userID".isLowerCamelized())
              XCTAssertTrue("urlString".isLowerCamelized())
              XCTAssertTrue("class2016".isLowerCamelized())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 158..170

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

      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 testIsNumeric() {
              XCTAssertTrue("-1.983388".isNumeric())
              XCTAssertTrue("-1".isNumeric())
              XCTAssertTrue("0".isNumeric())
              XCTAssertTrue("01".isNumeric())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 222..233

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

      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 testHiragana() {
              let hiragana = String.hiragana()
              XCTAssertTrue(hiragana.contains("\u{3041}"))
              XCTAssertTrue(hiragana.contains("\u{3096}"))
              XCTAssertTrue(hiragana.contains("な"))
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 32..39

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

      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 testKatakana() {
              let katakana = String.katakana()
              XCTAssertTrue(katakana.contains("\u{30A1}"))
              XCTAssertTrue(katakana.contains("\u{30F6}"))
              XCTAssertTrue(katakana.contains("ナ"))
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 23..30

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

      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

          static func katakana() -> String {
              var str: String = ""
              let unicodes = [Int](0x30A1...0x30F6)
              unicodes.forEach { (unicode: Int) in
                  str.append(Character(UnicodeScalar(unicode)!))
      Severity: Major
      Found in SwiftMoji/Classes/SwiftMoji.swift and 1 other location - About 1 hr to fix
      SwiftMoji/Classes/SwiftMoji.swift on lines 27..34

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

      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

          static func hiragana() -> String {
              var str: String = ""
              let unicodes = [Int](0x3041...0x3096)
              unicodes.forEach { (unicode: Int) in
                  str.append(Character(UnicodeScalar(unicode)!))
      Severity: Major
      Found in SwiftMoji/Classes/SwiftMoji.swift and 1 other location - About 1 hr to fix
      SwiftMoji/Classes/SwiftMoji.swift on lines 39..46

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

      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 testIsUppercased() {
              XCTAssertTrue("A".isUppercased())
              XCTAssertTrue("ABC".isUppercased())
              XCTAssertFalse("A_B_C".isUppercased())
              XCTAssertFalse("a".isUppercased())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 244..252

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

      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 testIsKatakana() {
              XCTAssertTrue("アイウエオ".isKatakana())
              XCTAssertTrue("\u{30A1}".isKatakana())
              XCTAssertTrue("\u{30FA}".isKatakana())
              XCTAssertFalse("abc".isKatakana())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 172..180

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

      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

          func testIsHiragana() {
              XCTAssertTrue("\u{3041}".isHiragana())
              XCTAssertTrue("\u{3096}".isHiragana())
              XCTAssertTrue("あいうえお".isHiragana())
              XCTAssertFalse("\u{3040}".isHiragana())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 148..156
      Example/Tests/SwiftMojiTests.swift on lines 182..189

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

      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

          func testIsAlphabet() {
              XCTAssertTrue("abc".isAlphabet())
              XCTAssertTrue("ABC".isAlphabet())
              
              XCTAssertFalse("".isAlphabet())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 182..189
      Example/Tests/SwiftMojiTests.swift on lines 235..242

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

      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

          func testIsLowercased() {
              XCTAssertTrue("a".isLowercased())
              XCTAssertTrue("abc".isLowercased())
              XCTAssertFalse("A".isLowercased())
              XCTAssertFalse("abC".isLowercased())
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 1 hr to fix
      Example/Tests/SwiftMojiTests.swift on lines 148..156
      Example/Tests/SwiftMojiTests.swift on lines 235..242

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

      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 isHiragana() -> Bool {
              guard !isEmpty else { return false }
              
              for unicodeScalar in unicodeScalars {
                  if !(unicodeScalar.value >= 0x3041 && unicodeScalar.value <= 0x3096) {
      Severity: Major
      Found in SwiftMoji/Classes/SwiftMoji.swift and 1 other location - About 1 hr to fix
      SwiftMoji/Classes/SwiftMoji.swift on lines 262..271

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

      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 isKatakana() -> Bool {
              guard !isEmpty else { return false }
              
              for unicodeScalar in unicodeScalars {
                  if !(unicodeScalar.value >= 0x30A1 && unicodeScalar.value <= 0x30FA) {
      Severity: Major
      Found in SwiftMoji/Classes/SwiftMoji.swift and 1 other location - About 1 hr to fix
      SwiftMoji/Classes/SwiftMoji.swift on lines 249..258

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

      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 testLowercasedFirst() {
              XCTAssertTrue("ABC".lowercasedFirst() == "aBC")
              XCTAssertTrue("abc".lowercasedFirst() == "abc")
              XCTAssertTrue("A".lowercasedFirst()   == "a")
              XCTAssertTrue("".lowercasedFirst()    == "")
      Severity: Minor
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 55 mins to fix
      Example/Tests/SwiftMojiTests.swift on lines 111..116

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

      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 testUppercasedFirst() {
              XCTAssertTrue("abc".uppercasedFirst() == "Abc")
              XCTAssertTrue("a".uppercasedFirst() == "A")
              XCTAssertTrue("".uppercasedFirst() == "")
              XCTAssertTrue("ABC".uppercasedFirst() == "ABC")
      Severity: Minor
      Found in Example/Tests/SwiftMojiTests.swift and 1 other location - About 55 mins to fix
      Example/Tests/SwiftMojiTests.swift on lines 118..123

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

      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

          func testFirst() {
              XCTAssert("abc".first() == "a")
              XCTAssert(" ".first() == " ")
              XCTAssert("".first() == "")
          }
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 40 mins to fix
      Example/Tests/SwiftMojiTests.swift on lines 78..82
      Example/Tests/SwiftMojiTests.swift on lines 254..258

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

      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

          func testLast() {
              XCTAssert("abc".last() == "c")
              XCTAssert(" ".last() == " ")
              XCTAssert("".last() == "")
          }
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 40 mins to fix
      Example/Tests/SwiftMojiTests.swift on lines 64..68
      Example/Tests/SwiftMojiTests.swift on lines 254..258

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

      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

          func testRemoveRedundantWhitespace() {
              XCTAssertTrue("abc    def".removeRedundantWhitespace() == "abc def")
              XCTAssertTrue("abcdef".removeRedundantWhitespace() == "abcdef")
              XCTAssertTrue("  abcdef".removeRedundantWhitespace() == "abcdef")
          }
      Severity: Major
      Found in Example/Tests/SwiftMojiTests.swift and 2 other locations - About 40 mins to fix
      Example/Tests/SwiftMojiTests.swift on lines 64..68
      Example/Tests/SwiftMojiTests.swift on lines 78..82

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

      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