wechaty/go-wechaty

View on GitHub

Showing 544 of 544 total issues

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

    Ready(forceSync bool) (err error)
Severity: Minor
Found in wechaty/interface/room.go and 1 other location - About 30 mins to fix
wechaty/interface/contact.go on lines 23..23

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

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

func (m *MessageSendFile) Write(p []byte) (n int, err error) {
    if len(p) == 0 {
        return 0, nil
    }
    fileDataRequest := &pbwechatypuppet.MessageSendFileStreamRequest{
Severity: Minor
Found in wechaty-puppet-service/filebox.go and 2 other locations - About 30 mins to fix
wechaty-puppet-service/filebox.go on lines 38..61
wechaty-puppet-service/filebox.go on lines 134..157

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

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

func (m *DownloadFile) Read(p []byte) (n int, err error) {
    if m.done {
        return m.buffer.Read(p)
    }

Severity: Minor
Found in wechaty-puppet-service/filebox.go and 2 other locations - About 30 mins to fix
wechaty-puppet-service/filebox.go on lines 38..61
wechaty-puppet-service/filebox.go on lines 80..95

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

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

    if e.evtListeners == nil {
        e.evtListeners = Events{}
    }
Severity: Minor
Found in wechaty-puppet/events/events.go and 1 other location - About 30 mins to fix
wechaty-puppet/events/events.go on lines 259..261

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

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

    if e.evtListeners == nil {
        e.evtListeners = Events{}
    }
Severity: Minor
Found in wechaty-puppet/events/events.go and 1 other location - About 30 mins to fix
wechaty-puppet/events/events.go on lines 114..116

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

    if m.done {
        return m.buffer.Read(p)
    }
Severity: Minor
Found in wechaty-puppet-service/filebox.go and 1 other location - About 30 mins to fix
wechaty-puppet-service/filebox.go on lines 135..137

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

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

func (m *MessageFile) Read(p []byte) (n int, err error) {
    if m.done {
        return m.buffer.Read(p)
    }

Severity: Minor
Found in wechaty-puppet-service/filebox.go and 2 other locations - About 30 mins to fix
wechaty-puppet-service/filebox.go on lines 80..95
wechaty-puppet-service/filebox.go on lines 134..157

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

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

Your code does not pass gofmt in 2 places. Go fmt your code!
Open

package file_box
Severity: Minor
Found in wechaty-puppet/file-box/type.go by gofmt

exported type FriendshipFactory should have comment or be unexported
Open

type FriendshipFactory struct {
Severity: Minor
Found in wechaty/factory/friendship.go by golint

exported type RoomFactory should have comment or be unexported
Open

type RoomFactory struct {
Severity: Minor
Found in wechaty/factory/room.go by golint

exported type RoomInvitationFactory should have comment or be unexported
Open

type RoomInvitationFactory struct {
Severity: Minor
Found in wechaty/factory/room_invitation.go by golint

exported type MessageFactory should have comment or be unexported
Open

type MessageFactory struct {
Severity: Minor
Found in wechaty/factory/message.go by golint

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

package memory_card

exported const FourPerEmSpace should have comment or be unexported
Open

const FourPerEmSpace = string(rune(8197))
Severity: Minor
Found in wechaty/config/config.go by golint

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

package wechaty
Severity: Minor
Found in wechaty/accessory.go by gofmt

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

package storage

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

package memory_card

exported type ContactFactory should have comment or be unexported
Open

type ContactFactory struct {
Severity: Minor
Found in wechaty/factory/contact.go by golint

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

package storage

exported method MessageFactory.Load should have comment or be unexported
Open

func (m *MessageFactory) Load(id string) _interface.IMessage {
Severity: Minor
Found in wechaty/factory/message.go by golint
Severity
Category
Status
Source
Language