vital-software/scala-redox

View on GitHub

Showing 18 of 21 total issues

File ClinicalSummaryTest.scala has 1072 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.github.vitalsoftware.scalaredox

import com.github.vitalsoftware.scalaredox.client.EmptyResponse
import com.github.vitalsoftware.scalaredox.models._
import org.joda.time.DateTime

    File GroupedOrdersTest.scala has 450 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.github.vitalsoftware.scalaredox
    
    import com.github.vitalsoftware.scalaredox.models.{ GroupedOrdersMessage, Order, SexType }
    import org.specs2.mutable.Specification
    
    

      File OrderTest.scala has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.github.vitalsoftware.scalaredox
      
      import com.github.vitalsoftware.scalaredox.client.EmptyResponse
      import com.github.vitalsoftware.scalaredox.models.OrderMessage
      import org.specs2.mutable.Specification
      Severity: Minor
      Found in src/test/scala/com/github/vitalsoftware/scalaredox/OrderTest.scala - About 5 hrs to fix

        File ResultsTest.scala has 297 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package com.github.vitalsoftware.scalaredox
        
        import com.github.vitalsoftware.scalaredox.client.EmptyResponse
        import com.github.vitalsoftware.scalaredox.models.{ Result, ResultsMessage }
        import org.specs2.mutable.Specification
        Severity: Minor
        Found in src/test/scala/com/github/vitalsoftware/scalaredox/ResultsTest.scala - About 3 hrs to fix

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

                  "data" -> Json.arr(
                    Json.obj("f1" -> "arr 1", "f2" -> "a"), // fail on f2 as its a string
                    Json.obj("f1" -> "arr 2", "f2" -> 2),
                    Json.obj("f1" -> "arr 3", "f2" -> "c"),
                    Json.obj("f1" -> "arr 4", "f2" -> "d"),
          src/test/scala/com/github/vitalsoftware/util/RobustParsingTest.scala on lines 85..91

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

          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

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

                val json = Json.arr(
                  Json.obj("f1" -> "arr 1", "f2" -> "a"), // fail on f2 as its a string
                  Json.obj("f1" -> "arr 2", "f2" -> 2),
                  Json.obj("f1" -> "arr 3", "f2" -> "c"),
                  Json.obj("f1" -> "arr 4", "f2" -> "d"),
          src/test/scala/com/github/vitalsoftware/util/RobustParsingTest.scala on lines 109..115

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

          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

          Function webhook has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def webhook(json: JsValue, reducer: JsValue => JsValue = identity): (Option[JsError], Option[AnyRef]) = {
              import com.github.vitalsoftware.scalaredox.models.DataModelTypes._
              import com.github.vitalsoftware.scalaredox.models.RedoxEventTypes._
              val reads = (__ \ "Meta").read[models.Meta]
              val unsupported = JsError("Not yet supported").errors

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

            package com.github.vitalsoftware.scalaredox.models
            
            import org.joda.time.DateTime
            import com.github.vitalsoftware.util.JsonImplicits.jodaISO8601Format
            import com.github.vitalsoftware.macros._
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Encounter.scala on lines 1..43

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

            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

            package com.github.vitalsoftware.scalaredox.models
            
            import org.joda.time.DateTime
            import com.github.vitalsoftware.util.JsonImplicits.jodaISO8601Format
            import com.github.vitalsoftware.macros._
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Problem.scala on lines 1..43

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

            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

            package com.github.vitalsoftware.scalaredox.models
            
            import org.joda.time.DateTime
            import com.github.vitalsoftware.util.JsonImplicits.jodaISO8601Format
            import com.github.vitalsoftware.macros._
            src/main/scala/com/github/vitalsoftware/scalaredox/models/MedicalEquipment.scala on lines 1..36
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Procedures.scala on lines 1..31

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

            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

            package com.github.vitalsoftware.scalaredox.models
            
            import com.github.vitalsoftware.macros._
            import com.github.vitalsoftware.util.RobustPrimitives
            
            
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Allergy.scala on lines 1..43
            src/main/scala/com/github/vitalsoftware/scalaredox/models/MedicalEquipment.scala on lines 1..36

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

            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

            package com.github.vitalsoftware.scalaredox.models
            
            import org.joda.time.DateTime
            import com.github.vitalsoftware.util.JsonImplicits.jodaISO8601Format
            import com.github.vitalsoftware.macros._
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Allergy.scala on lines 1..43
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Procedures.scala on lines 1..31

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

            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

            object InsuranceCoverageTypes extends Enumeration {
              val Patient, Clinic, Insurance, Other = Value
            
              def defaultValue = Other
              @transient implicit lazy val jsonFormat: Format[InsuranceCoverageTypes.Value] =
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Insurance.scala on lines 49..55

            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

            object InsuranceAgreementTypes extends Enumeration {
              val Standard, Unified, Maternity, Other = Value
            
              def defaultValue = Other
              @transient implicit lazy val jsonFormat: Format[InsuranceAgreementTypes.Value] =
            src/main/scala/com/github/vitalsoftware/scalaredox/models/Insurance.scala on lines 57..63

            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

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

                    Reads.of[JsArray].map {
                      case JsArray(arr) => JsArray(arr.updated(index, arr(index).transform(prune(afterArray)).get))
                    }
            src/main/scala/com/github/vitalsoftware/util/RobustParsing.scala on lines 84..86

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

            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

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

                      Reads.of[JsArray].map {
                        case JsArray(arr) => JsArray(arr.updated(index, arr(index).transform(prune(afterArray)).get))
                      }
            src/main/scala/com/github/vitalsoftware/util/RobustParsing.scala on lines 79..81

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

            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

              def get[T, U](query: T)(implicit writes: Writes[T], reads: Reads[U]): Future[RedoxResponse[U]] =
                sendReceive[U](baseQuery.withBody(Json.toJson(query)))
            src/main/scala/com/github/vitalsoftware/scalaredox/client/RedoxClient.scala on lines 84..85

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

            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

              def post[T, U](data: T)(implicit writes: Writes[T], reads: Reads[U]): Future[RedoxResponse[U]] =
                sendReceive[U](basePost.withBody(Json.toJson(data)))
            src/main/scala/com/github/vitalsoftware/scalaredox/client/RedoxClient.scala on lines 77..78

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

            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