kode4food/ale

View on GitHub

Showing 43 of 44 total issues

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

var (
    quoteSym  = env.RootSymbol("quote")
    consSym   = env.RootSymbol("cons")
    listSym   = env.RootSymbol("list")
    vectorSym = env.RootSymbol("vector")
Severity: Minor
Found in pkg/macro/syntax.go and 1 other location - About 50 mins to fix
pkg/core/asm.go on lines 72..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 119.

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

const (
    MakeSpecial = data.Local("!make-special")
    Resolve     = data.Local(".resolve")
    Evaluate    = data.Local(".eval")
    ForEach     = data.Local(".for-each")
Severity: Minor
Found in pkg/core/asm.go and 1 other location - About 50 mins to fix
pkg/macro/syntax.go on lines 20..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 119.

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 doNumEq(vm *VM) {
    vm.SP++
    SP1 := vm.SP + 1
    vm.MEM[SP1] = data.Bool(
        data.EqualTo == vm.MEM[SP1].(data.Number).Cmp(
Severity: Major
Found in internal/runtime/vm/inst-bool.go and 2 other locations - About 50 mins to fix
internal/runtime/vm/inst-bool.go on lines 29..38
internal/runtime/vm/inst-bool.go on lines 52..61

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

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 doNumGt(vm *VM) {
    vm.SP++
    SP1 := vm.SP + 1
    vm.MEM[SP1] = data.Bool(
        data.GreaterThan == vm.MEM[SP1].(data.Number).Cmp(
Severity: Major
Found in internal/runtime/vm/inst-bool.go and 2 other locations - About 50 mins to fix
internal/runtime/vm/inst-bool.go on lines 18..27
internal/runtime/vm/inst-bool.go on lines 52..61

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

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 doNumLt(vm *VM) {
    vm.SP++
    SP1 := vm.SP + 1
    vm.MEM[SP1] = data.Bool(
        data.LessThan == vm.MEM[SP1].(data.Number).Cmp(
Severity: Major
Found in internal/runtime/vm/inst-bool.go and 2 other locations - About 50 mins to fix
internal/runtime/vm/inst-bool.go on lines 18..27
internal/runtime/vm/inst-bool.go on lines 29..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 118.

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

Method mapWrapper.Wrap has 5 return statements (exceeds 4 allowed).
Open

func (w *mapWrapper) Wrap(c *Context, v reflect.Value) (data.Value, error) {
    if !v.IsValid() {
        return data.Null, nil
    }
    c, err := c.Push(v)
Severity: Major
Found in pkg/ffi/map.go - About 35 mins to fix

    Method mapWrapper.Unwrap has 5 return statements (exceeds 4 allowed).
    Open

    func (w *mapWrapper) Unwrap(v data.Value) (reflect.Value, error) {
        s, ok := v.(data.Sequence)
        if !ok {
            return _emptyValue, errors.New(ErrValueMustBeSequence)
        }
    Severity: Major
    Found in pkg/ffi/map.go - About 35 mins to fix

      Method List.Equal has 5 return statements (exceeds 4 allowed).
      Open

      func (l *List) Equal(other Value) bool {
          if l == nil {
              return l == other
          }
          cr, ok := other.(*List)
      Severity: Major
      Found in pkg/data/list.go - About 35 mins to fix

        Function expand1 has 5 return statements (exceeds 4 allowed).
        Open

        func expand1(ns env.Namespace, v data.Value) (data.Value, bool) {
            l, ok := v.(*data.List) // it's got to be a list
            if !ok {
                return v, false
            }
        Severity: Major
        Found in pkg/macro/macro.go - About 35 mins to fix

          Method Object.Equal has 5 return statements (exceeds 4 allowed).
          Open

          func (o *Object) Equal(other Value) bool {
              if o == nil || o == other {
                  return o == other
              }
              r, ok := other.(*Object)
          Severity: Major
          Found in pkg/data/object.go - About 35 mins to fix

            Method paramCases.isReachable has 5 return statements (exceeds 4 allowed).
            Open

            func (pc *paramCases) isReachable(i int, isRest bool) bool {
                if len(pc.cases) == 0 {
                    return true
                }
                if pc.hasRest {
            Severity: Major
            Found in pkg/core/params.go - About 35 mins to fix

              Method encoder.ResolveScoped has 5 return statements (exceeds 4 allowed).
              Open

              func (e *encoder) ResolveScoped(n data.Local) (*ScopedCell, bool) {
                  if i, ok := e.ResolveLocal(n); ok {
                      return newScopedCell(LocalScope, i.Cell), true
                  }
                  if _, ok := e.ResolveParam(n); ok {
              Severity: Major
              Found in internal/compiler/encoder/scope.go - About 35 mins to fix

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

                func (complex128Wrapper) Wrap(_ *Context, v reflect.Value) (data.Value, error) {
                    c := v.Complex()
                    r := data.Float(real(c))
                    i := data.Float(imag(c))
                    return data.NewCons(r, i), nil
                Severity: Minor
                Found in pkg/ffi/complex.go and 1 other location - About 35 mins to fix
                pkg/ffi/complex.go on lines 62..67

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

                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 (complex64Wrapper) Wrap(_ *Context, v reflect.Value) (data.Value, error) {
                    c := v.Complex()
                    r := data.Float(real(c))
                    i := data.Float(imag(c))
                    return data.NewCons(r, i), nil
                Severity: Minor
                Found in pkg/ffi/complex.go and 1 other location - About 35 mins to fix
                pkg/ffi/complex.go on lines 42..47

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

                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 (e *asmEncoder) copy() *asmEncoder {
                    res := *e
                    res.args = maps.Clone(res.args)
                    res.private = maps.Clone(res.private)
                    res.labels = maps.Clone(res.labels)
                Severity: Minor
                Found in pkg/core/asm.go and 1 other location - About 35 mins to fix
                internal/compiler/encoder/encoded.go on lines 44..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 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

                func (e *Encoded) Copy() *Encoded {
                    res := *e
                    res.Code = slices.Clone(e.Code)
                    res.Constants = slices.Clone(e.Constants)
                    res.Closure = slices.Clone(e.Closure)
                Severity: Minor
                Found in internal/compiler/encoder/encoded.go and 1 other location - About 35 mins to fix
                pkg/core/asm.go on lines 124..130

                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

                func (a *Applicable) Equal(other Type) bool {
                    if a == other {
                        return true
                    }
                    if other, ok := other.(*Applicable); ok {
                Severity: Minor
                Found in internal/types/applicable.go and 1 other location - About 30 mins to fix
                internal/types/record.go on lines 66..74

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

                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 5 locations. Consider refactoring.
                Open

                func doDiv(vm *VM) {
                    vm.SP++
                    SP1 := vm.SP + 1
                    vm.MEM[SP1] = vm.MEM[SP1].(data.Number).Div(
                        vm.MEM[vm.SP].(data.Number),
                Severity: Major
                Found in internal/runtime/vm/inst-math.go and 4 other locations - About 30 mins to fix
                internal/runtime/vm/inst-math.go on lines 5..12
                internal/runtime/vm/inst-math.go on lines 23..30
                internal/runtime/vm/inst-math.go on lines 32..39
                internal/runtime/vm/inst-math.go on lines 49..56

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

                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 (r *Record) Equal(other Type) bool {
                    if r == other {
                        return true
                    }
                    if other, ok := other.(*Record); ok {
                Severity: Minor
                Found in internal/types/record.go and 1 other location - About 30 mins to fix
                internal/types/applicable.go on lines 62..71

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

                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 5 locations. Consider refactoring.
                Open

                func doSub(vm *VM) {
                    vm.SP++
                    SP1 := vm.SP + 1
                    vm.MEM[SP1] = vm.MEM[SP1].(data.Number).Sub(
                        vm.MEM[vm.SP].(data.Number),
                Severity: Major
                Found in internal/runtime/vm/inst-math.go and 4 other locations - About 30 mins to fix
                internal/runtime/vm/inst-math.go on lines 5..12
                internal/runtime/vm/inst-math.go on lines 14..21
                internal/runtime/vm/inst-math.go on lines 23..30
                internal/runtime/vm/inst-math.go 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 102.

                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