meta/idl/interface.go

Summary

Maintainability
B
5 hrs
Test Coverage
B
83%

Method InterfaceType.registerMembers has 5 return statements (exceeds 4 allowed).
Open

func (itf *InterfaceType) registerMembers(set *signature.TypeSet) error {
    metaObj := itf.MetaObject()
    method := func(m object.MetaMethod, methodName string) error {
        method := itf.Methods[m.Uid]
        paramType := method.Tuple()
Severity: Major
Found in meta/idl/interface.go - About 35 mins to fix

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

    func (p Property) Meta(id uint32) object.MetaProperty {
        var meta object.MetaProperty
        meta.Uid = id
        meta.Name = p.Name
        types := make([]signature.Type, 0)
    Severity: Major
    Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
    meta/idl/interface.go on lines 120..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 143.

    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 (s Signal) Meta(id uint32) object.MetaSignal {
        var meta object.MetaSignal
        meta.Uid = id
        meta.Name = s.Name
        types := make([]signature.Type, 0)
    Severity: Major
    Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
    meta/idl/interface.go on lines 164..174

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

    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 (s Property) Tuple() *signature.TupleType {
        var tuple signature.TupleType
        tuple.Members = make([]signature.MemberType, 0)
        for _, p := range s.Params {
            tuple.Members = append(tuple.Members,
    Severity: Major
    Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
    meta/idl/interface.go on lines 97..108

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

    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 (s Signal) Tuple() *signature.TupleType {
        var tuple signature.TupleType
        tuple.Members = make([]signature.MemberType, 0)
        for _, p := range s.Params {
            tuple.Members = append(tuple.Members,
    Severity: Major
    Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
    meta/idl/interface.go on lines 141..152

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

    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

    receiver name p should be consistent with previous receiver name s for Property
    Open

    func (p Property) Type() signature.Type {
    Severity: Minor
    Found in meta/idl/interface.go by golint

    exported method InterfaceType.Type should have comment or be unexported
    Open

    func (s *InterfaceType) Type() reflect.Type {
    Severity: Minor
    Found in meta/idl/interface.go by golint

    receiver name p should be consistent with previous receiver name s for Property
    Open

    func (p Property) Meta(id uint32) object.MetaProperty {
    Severity: Minor
    Found in meta/idl/interface.go by golint

    exported method Method.Type should have comment or be unexported
    Open

    func (m Method) Type() signature.Type {
    Severity: Minor
    Found in meta/idl/interface.go by golint

    receiver name itf should be consistent with previous receiver name s for InterfaceType
    Open

    func (itf *InterfaceType) registerMembers(set *signature.TypeSet) error {
    Severity: Minor
    Found in meta/idl/interface.go by golint

    There are no issues that match your filters.

    Category
    Status