kode4food/ale

View on GitHub

Showing 43 of 44 total issues

Method VM.Run has 117 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (vm *VM) Run() data.Value {
    vm.initMem()
    for vm.ST == running {
        vm.INST = vm.CODE[vm.PC]
        switch vm.INST.Opcode() {
Severity: Major
Found in internal/runtime/vm/vm.go - About 3 hrs to fix

    Object has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type Object struct {
        pair     Pair
        children [bucketSize]*Object
    }
    Severity: Minor
    Found in pkg/data/object.go - About 2 hrs to fix

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

      func (l *BigInt) Div(r Number) Number {
          if ri, ok := r.(*BigInt); ok {
              lb := (*big.Int)(l)
              rb := (*big.Int)(ri)
              if rb.IsInt64() && rb.Int64() == 0 {
      Severity: Major
      Found in pkg/data/integer.go and 1 other location - About 1 hr to fix
      pkg/data/integer.go on lines 260..272

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

      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 (l *BigInt) Mod(r Number) Number {
          if ri, ok := r.(*BigInt); ok {
              lb := (*big.Int)(l)
              rb := (*big.Int)(ri)
              if rb.IsInt64() && rb.Int64() == 0 {
      Severity: Major
      Found in pkg/data/integer.go and 1 other location - About 1 hr to fix
      pkg/data/integer.go on lines 245..257

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

      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 _ has 57 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func _() {
          // An "invalid array index" compiler error signifies that the constant values have changed.
          // Re-run the stringer command to generate them again.
          var x [1]struct{}
          _ = x[opcodeMask-63]
      Severity: Minor
      Found in internal/runtime/isa/opcode_string.go - About 1 hr to fix

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

        func makeWrappedUnsignedInt(t reflect.Type) (Wrapper, error) {
            switch k := t.Kind(); k {
            case reflect.Uint:
                return uintWrapper(k), nil
            case reflect.Uint64:
        Severity: Major
        Found in pkg/ffi/uint.go and 1 other location - About 1 hr to fix
        pkg/ffi/int.go on lines 31..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 144.

        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 makeWrappedInt(t reflect.Type) (Wrapper, error) {
            switch k := t.Kind(); k {
            case reflect.Int:
                return intWrapper(k), nil
            case reflect.Int64:
        Severity: Major
        Found in pkg/ffi/int.go and 1 other location - About 1 hr to fix
        pkg/ffi/uint.go on lines 27..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 144.

        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

        func (l *Ratio) Sub(r Number) Number {
            if rr, ok := r.(*Ratio); ok {
                lb := (*big.Rat)(l)
                rb := (*big.Rat)(rr)
                res := new(big.Rat).Sub(lb, rb)
        Severity: Major
        Found in pkg/data/rational.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 221..230
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 216..225
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *BigInt) Sub(r Number) Number {
            if ri, ok := r.(*BigInt); ok {
                lb := (*big.Int)(l)
                rb := (*big.Int)(ri)
                res := new(big.Int).Sub(lb, rb)
        Severity: Major
        Found in pkg/data/integer.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 216..225
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *BigInt) Add(r Number) Number {
            if ri, ok := r.(*BigInt); ok {
                lb := (*big.Int)(l)
                rb := (*big.Int)(ri)
                res := new(big.Int).Add(lb, rb)
        Severity: Major
        Found in pkg/data/integer.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 221..230
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 216..225
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *BigInt) Mul(r Number) Number {
            if ri, ok := r.(*BigInt); ok {
                lb := (*big.Int)(l)
                rb := (*big.Int)(ri)
                res := new(big.Int).Mul(lb, rb)
        Severity: Major
        Found in pkg/data/integer.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 221..230
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 216..225
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *Ratio) Add(r Number) Number {
            if rr, ok := r.(*Ratio); ok {
                lb := (*big.Rat)(l)
                rb := (*big.Rat)(rr)
                res := new(big.Rat).Add(lb, rb)
        Severity: Major
        Found in pkg/data/rational.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 221..230
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 216..225
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *Ratio) Mul(r Number) Number {
            if rr, ok := r.(*Ratio); ok {
                lb := (*big.Rat)(l)
                rb := (*big.Rat)(rr)
                res := new(big.Rat).Mul(lb, rb)
        Severity: Major
        Found in pkg/data/rational.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 221..230
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 228..237

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

        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

        func (l *Ratio) Div(r Number) Number {
            if rr, ok := r.(*Ratio); ok {
                lb := (*big.Rat)(l)
                rb := (*big.Rat)(rr)
                res := new(big.Rat).Quo(lb, rb)
        Severity: Major
        Found in pkg/data/rational.go and 6 other locations - About 1 hr to fix
        pkg/data/integer.go on lines 209..218
        pkg/data/integer.go on lines 221..230
        pkg/data/integer.go on lines 233..242
        pkg/data/rational.go on lines 192..201
        pkg/data/rational.go on lines 204..213
        pkg/data/rational.go on lines 216..225

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

        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 (o *Object) Accepts(c *Checker, other Type) bool {
            if o == other {
                return true
            }
            if other, ok := other.(*Object); ok {
        Severity: Major
        Found in internal/types/object.go and 1 other location - About 1 hr to fix
        internal/types/pair.go on lines 34..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 136.

        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 (p *Pair) Accepts(c *Checker, other Type) bool {
            if p == other {
                return true
            }
            if other, ok := other.(*Pair); ok {
        Severity: Major
        Found in internal/types/pair.go and 1 other location - About 1 hr to fix
        internal/types/object.go on lines 36..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 136.

        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 doNumLte(vm *VM) {
            vm.SP++
            SP1 := vm.SP + 1
            cmp := vm.MEM[SP1].(data.Number).Cmp(
                vm.MEM[vm.SP].(data.Number),
        Severity: Major
        Found in internal/runtime/vm/inst-bool.go and 1 other location - About 1 hr to fix
        internal/runtime/vm/inst-bool.go on lines 40..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 135.

        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 doNumGte(vm *VM) {
            vm.SP++
            SP1 := vm.SP + 1
            cmp := vm.MEM[SP1].(data.Number).Cmp(
                vm.MEM[vm.SP].(data.Number),
        Severity: Major
        Found in internal/runtime/vm/inst-bool.go and 1 other location - About 1 hr to fix
        internal/runtime/vm/inst-bool.go on lines 63..73

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

        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 (l *BigInt) Cmp(r Number) Comparison {
            if ri, ok := r.(*BigInt); ok {
                lb := (*big.Int)(l)
                rb := (*big.Int)(ri)
                return Comparison(lb.Cmp(rb))
        Severity: Minor
        Found in pkg/data/integer.go and 1 other location - About 55 mins to fix
        pkg/data/rational.go on lines 181..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 126.

        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 (l *Ratio) Cmp(r Number) Comparison {
            if rr, ok := r.(*Ratio); ok {
                lb := (*big.Rat)(l)
                rb := (*big.Rat)(rr)
                return Comparison(lb.Cmp(rb))
        Severity: Minor
        Found in pkg/data/rational.go and 1 other location - About 55 mins to fix
        pkg/data/integer.go on lines 198..206

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

        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