snakazawa/github2slack

View on GitHub

Showing 45 of 45 total issues

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

export default class IssuesSerializer extends DefaultIssuesSerializer {
constructor () {
super();
this.NO_ASSIGNEE_MESSAGE = '(No assignee)';
this.ASSIGNEE_LABEL = 'Assignees: ';
Severity: Major
Found in task/template/serializer_package/issues_serializer.js and 1 other location - About 7 hrs to fix
src/serializer/jpn_serializer/issues_serializer.js on lines 5..29

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

export default class IssuesSerializer extends DefaultIssuesSerializer {
constructor () {
super();
this.NO_ASSIGNEE_MESSAGE = '(担当者γͺし)';
this.ASSIGNEE_LABEL = '担当者: ';
Severity: Major
Found in src/serializer/jpn_serializer/issues_serializer.js and 1 other location - About 7 hrs to fix
task/template/serializer_package/issues_serializer.js on lines 5..29

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

async serialize (payload: IssueCommentPayload): Promise<Message> {
return new Message({
title: await this._createTitle(payload),
body: await this._createBody(payload),
type: await this._createType(payload),
src/serializer/default_serializer/issues_serializer.js on lines 32..41
src/serializer/default_serializer/project_card_serializer.js on lines 11..20
src/serializer/default_serializer/project_column_serializer.js on lines 11..20
src/serializer/default_serializer/project_serializer.js on lines 11..20

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

async serialize (payload: ProjectColumnPayload): Promise<Message> {
return new Message({
title: await this._createTitle(payload),
body: await this._createBody(payload),
type: await this._createType(payload),
src/serializer/default_serializer/issue_comment_serializer.js on lines 11..20
src/serializer/default_serializer/issues_serializer.js on lines 32..41
src/serializer/default_serializer/project_card_serializer.js on lines 11..20
src/serializer/default_serializer/project_serializer.js on lines 11..20

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

async serialize (payload: ProjectCardPayload): Promise<Message> {
return new Message({
title: await this._createTitle(payload),
body: await this._createBody(payload),
type: await this._createType(payload),
src/serializer/default_serializer/issue_comment_serializer.js on lines 11..20
src/serializer/default_serializer/issues_serializer.js on lines 32..41
src/serializer/default_serializer/project_column_serializer.js on lines 11..20
src/serializer/default_serializer/project_serializer.js on lines 11..20

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

async serialize (payload: ProjectPayload): Promise<Message> {
return new Message({
title: await this._createTitle(payload),
body: await this._createBody(payload),
type: await this._createType(payload),
Severity: Major
Found in src/serializer/default_serializer/project_serializer.js and 4 other locations - About 4 hrs to fix
src/serializer/default_serializer/issue_comment_serializer.js on lines 11..20
src/serializer/default_serializer/issues_serializer.js on lines 32..41
src/serializer/default_serializer/project_card_serializer.js on lines 11..20
src/serializer/default_serializer/project_column_serializer.js on lines 11..20

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

async serialize (payload: IssuesPayload): Promise<Message> {
return new Message({
title: await this._createTitle(payload),
body: await this._createBody(payload),
type: await this._createType(payload),
Severity: Major
Found in src/serializer/default_serializer/issues_serializer.js and 4 other locations - About 4 hrs to fix
src/serializer/default_serializer/issue_comment_serializer.js on lines 11..20
src/serializer/default_serializer/project_card_serializer.js on lines 11..20
src/serializer/default_serializer/project_column_serializer.js on lines 11..20
src/serializer/default_serializer/project_serializer.js on lines 11..20

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

export default class IssuesCommentSerializer implements ISerializer<IssueCommentPayload> {
async serialize (payload: IssueCommentPayload): Promise<Message> {
 
 
return new Message({
task/template/custom_serializer_package/issues_serializer.js on lines 8..19

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

export default class IssuesSerializer implements ISerializer<IssuesPayload> {
async serialize (payload: IssuesPayload): Promise<Message> {
return new Message({
title: null, // TODO
body: null, // TODO
Severity: Major
Found in task/template/custom_serializer_package/issues_serializer.js and 1 other location - About 3 hrs to fix
task/template/custom_serializer_package/issue_comment_serializer.js on lines 8..21

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

constructor (params: any = {}) {
super(params);
this.action = params.action;
this.changes = params.changes;
this.after_id = params.after_id;
Severity: Major
Found in src/model/github/project_card_payload.js and 2 other locations - About 2 hrs to fix
src/model/github/issue_comment_payload.js on lines 12..18
src/model/github/project_column_payload.js on lines 14..20

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

constructor (params: any = {}) {
super(params);
this.action = params.action;
this.changes = params.changes;
this.after_id = params.after_id;
Severity: Major
Found in src/model/github/project_column_payload.js and 2 other locations - About 2 hrs to fix
src/model/github/issue_comment_payload.js on lines 12..18
src/model/github/project_card_payload.js on lines 14..20

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

constructor (params: any = {}) {
super(params);
this.action = params.action;
this.issue = params.issue;
this.comment = params.comment;
Severity: Major
Found in src/model/github/issue_comment_payload.js and 2 other locations - About 2 hrs to fix
src/model/github/project_card_payload.js on lines 14..20
src/model/github/project_column_payload.js on lines 14..20

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

export default class ProjectSerializer extends DefaultProjectSerializer {
_createComment (action: string): string {
switch (action) {
case 'created': return 'ζ–°γ—γ„γƒ—γƒ­γ‚Έγ‚§γ‚―γƒˆ';
case 'edited': return 'γƒ—γƒ­γ‚Έγ‚§γ‚―γƒˆγŒη·¨ι›†γ•γ‚ŒγΎγ—γŸ';
Severity: Major
Found in src/serializer/jpn_serializer/project_serializer.js and 1 other location - About 2 hrs to fix
src/serializer/jpn_serializer/project_card_serializer.js on lines 5..16

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

export default class ProjectCardSerializer extends DefaultProjectCardSerializer {
_createComment (action: string): string {
switch (action) {
case 'created': return 'ζ–°γ—γ„γƒ—γƒ­γ‚Έγ‚§γ‚―γƒˆγ‚«γƒΌγƒ‰';
case 'edited': return 'γƒ—γƒ­γ‚Έγ‚§γ‚―γƒˆγ‚«γƒΌγƒ‰γŒη·¨ι›†γ•γ‚ŒγΎγ—γŸ';
Severity: Major
Found in src/serializer/jpn_serializer/project_card_serializer.js and 1 other location - About 2 hrs to fix
src/serializer/jpn_serializer/project_serializer.js on lines 5..16

Function _createBody has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

async _createBody (payload: IssuesPayload): Promise<string> {
const {title, body, assignees, labels, milestone} = payload.issue;
const params = this._preBodySerialize(payload.action);
 
let res = '';
Severity: Minor
Found in src/serializer/default_serializer/issues_serializer.js - About 2 hrs to fix

Function serialize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async serialize (eventName: string, body: any): Promise<Message> {
if (!body) {
throw new Error('invalid body: (empty)');
}
 
 
Severity: Minor
Found in src/serializer/serializer_master.js - About 1 hr to fix

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

    export default class IssuesCommentSerializer extends DefaultIssuesCommentSerializer {
    _createComment (action: string): string {
    switch (action) {
    case 'created': return 'New issue comment';
    case 'edited': return 'Edited issue comment';
    src/serializer/jpn_serializer/issue_comment_serializer.js on lines 5..14

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

    export default class IssuesCommentSerializer extends DefaultIssuesCommentSerializer {
    _createComment (action: string): string {
    switch (action) {
    case 'created': return 'ζ–°γ—γ„γ‚³γƒ‘γƒ³γƒˆ';
    case 'edited': return 'γ‚³γƒ‘γƒ³γƒˆγŒη·¨ι›†γ•γ‚ŒγΎγ—γŸ';
    Severity: Major
    Found in src/serializer/jpn_serializer/issue_comment_serializer.js and 1 other location - About 1 hr to fix
    task/template/serializer_package/issue_comment_serializer.js on lines 5..14

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

    constructor (params: any = {}) {
    super(params);
    this.action = params.action;
    this.changes = params.changes;
    this.project = params.project;
    Severity: Major
    Found in src/model/github/project_payload.js and 1 other location - About 1 hr to fix
    src/model/github/issues_payload.js on lines 12..17

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

    constructor (params: any = {}) {
    super(params);
    this.action = params.action;
    this.issue = params.issue;
    this.changes = params.changes;
    Severity: Major
    Found in src/model/github/issues_payload.js and 1 other location - About 1 hr to fix
    src/model/github/project_payload.js on lines 11..16
    Severity
    Category
    Status
    Source
    Language