Showing 9 of 9 total issues
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)'); }
Function serialize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
async serialize (eventName: string, body: any): Promise<Message> { if (!body) { throw new Error('invalid body: (empty)'); }
- Read upRead up
Avoid too many return
statements within this function. Open
return this.serializers.projectColumn.serialize(new ProjectColumnPayload(body));
Avoid too many return
statements within this function. Open
return this.serializers.projectCard.serialize(new ProjectCardPayload(body));
Similar blocks of code found in 5 locations. Consider refactoring. Open
case 'issue_comment': if (!this.serializers.issueComment) { throw new Error(`serializer was not found: ${this.packageName}.IssueCommentEvent`); } return this.serializers.issueComment.serialize(new IssueCommentPayload(body));
- Read upRead up
Similar blocks of code found in 5 locations. Consider refactoring. Open
case 'project_column': if (!this.serializers.projectColumn) { throw new Error(`serializer was not found: ${this.packageName}.ProjectColumnEvent`); } return this.serializers.projectColumn.serialize(new ProjectColumnPayload(body));
- Read upRead up
Similar blocks of code found in 5 locations. Consider refactoring. Open
case 'project': if (!this.serializers.project) { throw new Error(`serializer was not found: ${this.packageName}.ProjectEvent`); } return this.serializers.project.serialize(new ProjectPayload(body));
- Read upRead up
Similar blocks of code found in 5 locations. Consider refactoring. Open
case 'issues': if (!this.serializers.issues) { throw new Error(`serializer was not found: ${this.packageName}.IssuesEvent`); } return this.serializers.issues.serialize(new IssuesPayload(body));
- Read upRead up
Similar blocks of code found in 5 locations. Consider refactoring. Open
case 'gollum': if (!this.serializers.gollum) { throw new Error(`serializer was not found: ${this.packageName}.GollumEvent`); } return this.serializers.gollum.serialize(new GollumPayload(body));
- Read upRead up