wechaty/go-wechaty

View on GitHub
wechaty-puppet-mock/puppet_mock.go

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

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

func (p PuppetMock) MessageImage(messageID string, imageType schemas.ImageType) (*filebox.FileBox, error) {
    panic("implement me")
}
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go and 2 other locations - About 40 mins to fix
wechaty-puppet-service/puppet_service.go on lines 119..129
wechaty-puppet/puppet.go on lines 15..15

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

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 (p *PuppetMock) RoomMemberRawPayload(roomID string, contactID string) (*schemas.RoomMemberPayload, error) {
    panic("implement me")
}
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go and 2 other locations - About 35 mins to fix
wechaty-puppet-service/puppet_service.go on lines 975..991
wechaty-puppet/puppet.go on lines 53..53

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

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 (p *PuppetMock) SetContactAvatar(contactID string, fileBox *filebox.FileBox) error {
    panic("implement me")
}
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go and 2 other locations - About 30 mins to fix
wechaty-puppet-service/puppet_service.go on lines 416..436
wechaty-puppet/puppet.go on lines 24..24

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

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

don't use an underscore in package name
Open

package wechaty_puppet_mock
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendFile should have comment or be unexported
Open

func (p PuppetMock) MessageSendFile(conversationID string, fileBox *filebox.FileBox) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.Ding should have comment or be unexported
Open

func (p *PuppetMock) Ding(data string) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetContactAvatar should have comment or be unexported
Open

func (p *PuppetMock) SetContactAvatar(contactID string, fileBox *filebox.FileBox) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetContactSelfSignature should have comment or be unexported
Open

func (p *PuppetMock) SetContactSelfSignature(signature string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomQRCode should have comment or be unexported
Open

func (p *PuppetMock) RoomQRCode(roomID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

method parameter mentionIdList should be mentionIDList
Open

func (p PuppetMock) MessageSendText(conversationID string, text string, mentionIdList ...string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomDel should have comment or be unexported
Open

func (p *PuppetMock) RoomDel(roomID, contactID string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.FriendshipSearchWeixin should have comment or be unexported
Open

func (p *PuppetMock) FriendshipSearchWeixin(weixin string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.Stop should have comment or be unexported
Open

func (p *PuppetMock) Stop() {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactSelfQRCode should have comment or be unexported
Open

func (p *PuppetMock) ContactSelfQRCode() (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageContact should have comment or be unexported
Open

func (p *PuppetMock) MessageContact(messageID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomMemberRawPayload should have comment or be unexported
Open

func (p *PuppetMock) RoomMemberRawPayload(roomID string, contactID string) (*schemas.RoomMemberPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactAvatar should have comment or be unexported
Open

func (p *PuppetMock) ContactAvatar(contactID string) (*filebox.FileBox, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.FriendshipAdd should have comment or be unexported
Open

func (p *PuppetMock) FriendshipAdd(contactID, hello string) (err error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.TagContactRemove should have comment or be unexported
Open

func (p *PuppetMock) TagContactRemove(id, contactID string) (err error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageImage should have comment or be unexported
Open

func (p PuppetMock) MessageImage(messageID string, imageType schemas.ImageType) (*filebox.FileBox, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomInvitationRawPayload should have comment or be unexported
Open

func (p PuppetMock) RoomInvitationRawPayload(roomInvitationID string) (*schemas.RoomInvitationPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageRawPayload should have comment or be unexported
Open

func (p *PuppetMock) MessageRawPayload(id string) (*schemas.MessagePayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomAvatar should have comment or be unexported
Open

func (p *PuppetMock) RoomAvatar(roomID string) (*filebox.FileBox, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.TagContactAdd should have comment or be unexported
Open

func (p *PuppetMock) TagContactAdd(id, contactID string) (err error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendLocation should have comment or be unexported
Open

func (p *PuppetMock) MessageSendLocation(conversationID string, payload *schemas.LocationPayload) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.FriendshipAccept should have comment or be unexported
Open

func (p PuppetMock) FriendshipAccept(friendshipID string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetContactAlias should have comment or be unexported
Open

func (p *PuppetMock) SetContactAlias(contactID string, alias string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomAnnounce should have comment or be unexported
Open

func (p *PuppetMock) RoomAnnounce(roomID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendContact should have comment or be unexported
Open

func (p PuppetMock) MessageSendContact(conversationID string, contactID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageMiniProgram should have comment or be unexported
Open

func (p *PuppetMock) MessageMiniProgram(messageID string) (*schemas.MiniProgramPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageRecall should have comment or be unexported
Open

func (p *PuppetMock) MessageRecall(messageID string) (bool, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageFile should have comment or be unexported
Open

func (p *PuppetMock) MessageFile(id string) (*filebox.FileBox, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomMemberList should have comment or be unexported
Open

func (p *PuppetMock) RoomMemberList(roomID string) ([]string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.FriendshipRawPayload should have comment or be unexported
Open

func (p PuppetMock) FriendshipRawPayload(friendshipID string) (*schemas.FriendshipPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactQRCode should have comment or be unexported
Open

func (p *PuppetMock) ContactQRCode(contactID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactList should have comment or be unexported
Open

func (p *PuppetMock) ContactList() ([]string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactRawPayload should have comment or be unexported
Open

func (p *PuppetMock) ContactRawPayload(contactID string) (*schemas.ContactPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported type PuppetMock should have comment or be unexported
Open

type PuppetMock struct {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomCreate should have comment or be unexported
Open

func (p *PuppetMock) RoomCreate(contactIDList []string, topic string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetContactSelfName should have comment or be unexported
Open

func (p *PuppetMock) SetContactSelfName(name string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.FriendshipSearchPhone should have comment or be unexported
Open

func (p *PuppetMock) FriendshipSearchPhone(phone string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomAdd should have comment or be unexported
Open

func (p *PuppetMock) RoomAdd(roomID, contactID string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.TagContactDelete should have comment or be unexported
Open

func (p *PuppetMock) TagContactDelete(id string) (err error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.TagContactList should have comment or be unexported
Open

func (p *PuppetMock) TagContactList(contactID string) ([]string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageRawMiniProgramPayload should have comment or be unexported
Open

func (p *PuppetMock) MessageRawMiniProgramPayload(messageID string) (*schemas.MiniProgramPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendMiniProgram should have comment or be unexported
Open

func (p PuppetMock) MessageSendMiniProgram(conversationID string, urlLinkPayload *schemas.MiniProgramPayload) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageURL should have comment or be unexported
Open

func (p *PuppetMock) MessageURL(messageID string) (*schemas.UrlLinkPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetRoomTopic should have comment or be unexported
Open

func (p *PuppetMock) SetRoomTopic(roomID string, topic string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendURL should have comment or be unexported
Open

func (p PuppetMock) MessageSendURL(conversationID string, urlLinkPayload *schemas.UrlLinkPayload) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomRawPayload should have comment or be unexported
Open

func (p *PuppetMock) RoomRawPayload(id string) (*schemas.RoomPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomList should have comment or be unexported
Open

func (p *PuppetMock) RoomList() ([]string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageLocation should have comment or be unexported
Open

func (p *PuppetMock) MessageLocation(messageID string) (*schemas.LocationPayload, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.ContactAlias should have comment or be unexported
Open

func (p *PuppetMock) ContactAlias(contactID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomTopic should have comment or be unexported
Open

func (p *PuppetMock) RoomTopic(roomID string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.SetRoomAnnounce should have comment or be unexported
Open

func (p *PuppetMock) SetRoomAnnounce(roomID, text string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.Start should have comment or be unexported
Open

func (p *PuppetMock) Start() error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomQuit should have comment or be unexported
Open

func (p *PuppetMock) RoomQuit(roomID string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported function NewPuppetMock should have comment or be unexported
Open

func NewPuppetMock(option wechatyPuppet.Option) (*PuppetMock, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.RoomInvitationAccept should have comment or be unexported
Open

func (p PuppetMock) RoomInvitationAccept(roomInvitationID string) error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.MessageSendText should have comment or be unexported
Open

func (p PuppetMock) MessageSendText(conversationID string, text string, mentionIdList ...string) (string, error) {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

exported method PuppetMock.Logout should have comment or be unexported
Open

func (p *PuppetMock) Logout() error {
Severity: Minor
Found in wechaty-puppet-mock/puppet_mock.go by golint

There are no issues that match your filters.

Category
Status