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")
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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")
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
func (p *PuppetMock) SetContactAvatar(contactID string, fileBox *filebox.FileBox) error {
panic("implement me")
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
exported method PuppetMock.ContactAvatar should have comment or be unexported Open
func (p *PuppetMock) ContactAvatar(contactID string) (*filebox.FileBox, error) {
- Exclude checks
exported method PuppetMock.RoomList should have comment or be unexported Open
func (p *PuppetMock) RoomList() ([]string, error) {
- Exclude checks
exported method PuppetMock.RoomAnnounce should have comment or be unexported Open
func (p *PuppetMock) RoomAnnounce(roomID string) (string, error) {
- Exclude checks
exported method PuppetMock.FriendshipRawPayload should have comment or be unexported Open
func (p PuppetMock) FriendshipRawPayload(friendshipID string) (*schemas.FriendshipPayload, error) {
- Exclude checks
exported method PuppetMock.ContactSelfQRCode should have comment or be unexported Open
func (p *PuppetMock) ContactSelfQRCode() (string, error) {
- Exclude checks
exported method PuppetMock.MessageRecall should have comment or be unexported Open
func (p *PuppetMock) MessageRecall(messageID string) (bool, error) {
- Exclude checks
exported method PuppetMock.TagContactAdd should have comment or be unexported Open
func (p *PuppetMock) TagContactAdd(id, contactID string) (err error) {
- Exclude checks
exported method PuppetMock.MessageMiniProgram should have comment or be unexported Open
func (p *PuppetMock) MessageMiniProgram(messageID string) (*schemas.MiniProgramPayload, error) {
- Exclude checks
exported method PuppetMock.MessageContact should have comment or be unexported Open
func (p *PuppetMock) MessageContact(messageID string) (string, error) {
- Exclude checks
exported method PuppetMock.RoomAvatar should have comment or be unexported Open
func (p *PuppetMock) RoomAvatar(roomID string) (*filebox.FileBox, error) {
- Exclude checks
exported method PuppetMock.MessageSendContact should have comment or be unexported Open
func (p PuppetMock) MessageSendContact(conversationID string, contactID string) (string, error) {
- Exclude checks
exported method PuppetMock.SetContactSelfName should have comment or be unexported Open
func (p *PuppetMock) SetContactSelfName(name string) error {
- Exclude checks
exported method PuppetMock.TagContactList should have comment or be unexported Open
func (p *PuppetMock) TagContactList(contactID string) ([]string, error) {
- Exclude checks
exported method PuppetMock.RoomInvitationRawPayload should have comment or be unexported Open
func (p PuppetMock) RoomInvitationRawPayload(roomInvitationID string) (*schemas.RoomInvitationPayload, error) {
- Exclude checks
exported method PuppetMock.Stop should have comment or be unexported Open
func (p *PuppetMock) Stop() {
- Exclude checks
exported method PuppetMock.ContactAlias should have comment or be unexported Open
func (p *PuppetMock) ContactAlias(contactID string) (string, error) {
- Exclude checks
exported method PuppetMock.ContactRawPayload should have comment or be unexported Open
func (p *PuppetMock) ContactRawPayload(contactID string) (*schemas.ContactPayload, error) {
- Exclude checks
exported method PuppetMock.MessageRawPayload should have comment or be unexported Open
func (p *PuppetMock) MessageRawPayload(id string) (*schemas.MessagePayload, error) {
- Exclude checks
exported method PuppetMock.FriendshipSearchWeixin should have comment or be unexported Open
func (p *PuppetMock) FriendshipSearchWeixin(weixin string) (string, error) {
- Exclude checks
exported method PuppetMock.FriendshipAccept should have comment or be unexported Open
func (p PuppetMock) FriendshipAccept(friendshipID string) error {
- Exclude checks
exported method PuppetMock.RoomQuit should have comment or be unexported Open
func (p *PuppetMock) RoomQuit(roomID string) error {
- Exclude checks
exported method PuppetMock.SetRoomAnnounce should have comment or be unexported Open
func (p *PuppetMock) SetRoomAnnounce(roomID, text string) error {
- Exclude checks
exported function NewPuppetMock should have comment or be unexported Open
func NewPuppetMock(option wechatyPuppet.Option) (*PuppetMock, error) {
- Exclude checks
method parameter mentionIdList should be mentionIDList Open
func (p PuppetMock) MessageSendText(conversationID string, text string, mentionIdList ...string) (string, error) {
- Exclude checks
exported method PuppetMock.Logout should have comment or be unexported Open
func (p *PuppetMock) Logout() error {
- Exclude checks
exported method PuppetMock.RoomQRCode should have comment or be unexported Open
func (p *PuppetMock) RoomQRCode(roomID string) (string, error) {
- Exclude checks
exported method PuppetMock.SetContactAlias should have comment or be unexported Open
func (p *PuppetMock) SetContactAlias(contactID string, alias string) error {
- Exclude checks
exported method PuppetMock.FriendshipAdd should have comment or be unexported Open
func (p *PuppetMock) FriendshipAdd(contactID, hello string) (err error) {
- Exclude checks
exported method PuppetMock.SetContactAvatar should have comment or be unexported Open
func (p *PuppetMock) SetContactAvatar(contactID string, fileBox *filebox.FileBox) error {
- Exclude checks
exported method PuppetMock.MessageSendFile should have comment or be unexported Open
func (p PuppetMock) MessageSendFile(conversationID string, fileBox *filebox.FileBox) (string, error) {
- Exclude checks
exported method PuppetMock.MessageURL should have comment or be unexported Open
func (p *PuppetMock) MessageURL(messageID string) (*schemas.UrlLinkPayload, error) {
- Exclude checks
exported method PuppetMock.RoomMemberRawPayload should have comment or be unexported Open
func (p *PuppetMock) RoomMemberRawPayload(roomID string, contactID string) (*schemas.RoomMemberPayload, error) {
- Exclude checks
exported method PuppetMock.FriendshipSearchPhone should have comment or be unexported Open
func (p *PuppetMock) FriendshipSearchPhone(phone string) (string, error) {
- Exclude checks
exported method PuppetMock.TagContactRemove should have comment or be unexported Open
func (p *PuppetMock) TagContactRemove(id, contactID string) (err error) {
- Exclude checks
exported method PuppetMock.Start should have comment or be unexported Open
func (p *PuppetMock) Start() error {
- Exclude checks
exported method PuppetMock.Ding should have comment or be unexported Open
func (p *PuppetMock) Ding(data string) {
- Exclude checks
exported method PuppetMock.SetContactSelfSignature should have comment or be unexported Open
func (p *PuppetMock) SetContactSelfSignature(signature string) error {
- Exclude checks
exported method PuppetMock.RoomAdd should have comment or be unexported Open
func (p *PuppetMock) RoomAdd(roomID, contactID string) error {
- Exclude checks
exported method PuppetMock.TagContactDelete should have comment or be unexported Open
func (p *PuppetMock) TagContactDelete(id string) (err error) {
- Exclude checks
exported method PuppetMock.MessageLocation should have comment or be unexported Open
func (p *PuppetMock) MessageLocation(messageID string) (*schemas.LocationPayload, error) {
- Exclude checks
exported method PuppetMock.RoomTopic should have comment or be unexported Open
func (p *PuppetMock) RoomTopic(roomID string) (string, error) {
- Exclude checks
exported type PuppetMock should have comment or be unexported Open
type PuppetMock struct {
- Exclude checks
exported method PuppetMock.MessageImage should have comment or be unexported Open
func (p PuppetMock) MessageImage(messageID string, imageType schemas.ImageType) (*filebox.FileBox, error) {
- Exclude checks
exported method PuppetMock.RoomInvitationAccept should have comment or be unexported Open
func (p PuppetMock) RoomInvitationAccept(roomInvitationID string) error {
- Exclude checks
exported method PuppetMock.ContactList should have comment or be unexported Open
func (p *PuppetMock) ContactList() ([]string, error) {
- Exclude checks
exported method PuppetMock.ContactQRCode should have comment or be unexported Open
func (p *PuppetMock) ContactQRCode(contactID string) (string, error) {
- Exclude checks
exported method PuppetMock.RoomRawPayload should have comment or be unexported Open
func (p *PuppetMock) RoomRawPayload(id string) (*schemas.RoomPayload, error) {
- Exclude checks
exported method PuppetMock.SetRoomTopic should have comment or be unexported Open
func (p *PuppetMock) SetRoomTopic(roomID string, topic string) error {
- Exclude checks
exported method PuppetMock.RoomCreate should have comment or be unexported Open
func (p *PuppetMock) RoomCreate(contactIDList []string, topic string) (string, error) {
- Exclude checks
exported method PuppetMock.MessageSendMiniProgram should have comment or be unexported Open
func (p PuppetMock) MessageSendMiniProgram(conversationID string, urlLinkPayload *schemas.MiniProgramPayload) (string, error) {
- Exclude checks
exported method PuppetMock.MessageFile should have comment or be unexported Open
func (p *PuppetMock) MessageFile(id string) (*filebox.FileBox, error) {
- Exclude checks
don't use an underscore in package name Open
package wechaty_puppet_mock
- Exclude checks
exported method PuppetMock.MessageSendText should have comment or be unexported Open
func (p PuppetMock) MessageSendText(conversationID string, text string, mentionIdList ...string) (string, error) {
- Exclude checks
exported method PuppetMock.RoomMemberList should have comment or be unexported Open
func (p *PuppetMock) RoomMemberList(roomID string) ([]string, error) {
- Exclude checks
exported method PuppetMock.MessageRawMiniProgramPayload should have comment or be unexported Open
func (p *PuppetMock) MessageRawMiniProgramPayload(messageID string) (*schemas.MiniProgramPayload, error) {
- Exclude checks
exported method PuppetMock.MessageSendLocation should have comment or be unexported Open
func (p *PuppetMock) MessageSendLocation(conversationID string, payload *schemas.LocationPayload) (string, error) {
- Exclude checks
exported method PuppetMock.MessageSendURL should have comment or be unexported Open
func (p PuppetMock) MessageSendURL(conversationID string, urlLinkPayload *schemas.UrlLinkPayload) (string, error) {
- Exclude checks
exported method PuppetMock.RoomDel should have comment or be unexported Open
func (p *PuppetMock) RoomDel(roomID, contactID string) error {
- Exclude checks