Showing 110 of 172 total issues
Function run
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ bodyText, roomName, sender }: CommandOptions) {
const jiraBotUser = this.config.taskTracker.user;
const projectKey = utils.getProjectKeyFromIssueKey(roomName);
const { lead, issueTypes, admins } = await this.taskTracker.getProjectWithAdmins(projectKey);
GitlabParser
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class GitlabParser implements Parser {
issueMovedType = 'issueMovedType';
constructor(private features: Config['features'], private selectors: GitlabSelectors) {}
Function run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async run({ issue, projectKey, milestoneId }: CreateRoomData): Promise<boolean> {
try {
const keyOrId = issue.key || issue.id;
if (issue && keyOrId) {
const issueBody = await this.taskTracker.getIssueSafety(keyOrId);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ bodyText = '', roomName }: CommandOptions) {
if (!roomName) {
throw new Error('Not issue room');
}
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ bodyText, roomData }: CommandOptions) {
if (!this.chatApi.isMaster()) {
logger.warn('Skip operation for not master bot');
return;
Function handleRedisData
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
async handleRedisData(dataFromRedis) {
try {
if (!dataFromRedis) {
logger.warn('No data from redis');
Function getChatFsm
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getChatFsm = (chatFasade: ChatFasade, handler: QueueHandler): StateMachine => {
const startTime = Date.now();
const fsm = new StateMachine({
init: states.init,
transitions: [
Function timelineHandler
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
async timelineHandler(event: any, room: any, toStartOfTimeline: boolean) {
try {
if (event.getType() !== 'm.room.message' || toStartOfTimeline) {
return;
}
Function run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ issue, projectKey, milestoneId }: CreateRoomData): Promise<boolean> {
try {
const keyOrId = issue.key || issue.id;
if (issue && keyOrId) {
const issueBody = await this.taskTracker.getIssueSafety(keyOrId);
Function parseTextBody
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseTextBody(body: string): SuccessParse | FailParse {
try {
const trimedBody = body.trim();
const commandNameFromUser = R.pipe(
Function run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ bodyText, roomId, roomName }: CommandOptions) {
if (!roomName) {
throw new Error('Not issue room');
}
if (!bodyText) {
Function run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async run({ bodyText, roomName, sender }: CommandOptions) {
const jiraBotUser = this.config.taskTracker.user;
const projectKey = utils.getProjectKeyFromIssueKey(roomName);
const { lead, issueTypes, admins } = await this.taskTracker.getProjectWithAdmins(projectKey);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async run({ bodyText, roomId, roomName }: CommandOptions) {
if (!roomName) {
throw new Error('Not issue room');
}
if (!bodyText) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async run({ bodyText, sender, roomData }: CommandOptions) {
if (!roomData.alias) {
throw new Error('Not issue room');
}
try {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getMessageByStatus
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getMessageByStatus(
status: MilestoneUpdateStatus,
milestone: { key: string },
issue: { key: string; summary: string; user: string },
): Promise<MessageWithSendStatus> {
Function run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run(
commandName: string | CommandNames,
{ chatApi, roomData, roomId, roomName, sender, bodyText, url, senderDisplayName }: RunCommandsOptions,
) {
try {
Function createIssueRoom
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async createIssueRoom({
key,
summary,
projectKey,
descriptionFields,
Function run
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async run({ bodyText, sender, roomData }: CommandOptions) {
if (!roomData.alias) {
throw new Error('Not issue room');
}
try {
Function getPostIssueUpdatesData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPostIssueUpdatesData(body): PostIssueUpdatesData {
const author = this.selectors.getDisplayName(body)!;
const changes = this.selectors.getIssueChanges(body)!;
const hookLabels = this.selectors.getIssueLabels(body);
const newTitleData = changes.find(data => data.field === 'title');
Function archiveAndForget
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
async archiveAndForget({
client,
roomData,
keepTimestamp,
}: {