Showing 110 of 172 total issues
File matrix-api.ts
has 787 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-undefined */
/* eslint no-empty-function: ["error", { "allow": ["arrowFunctions"] }] */
import matrixSdk from 'matrix-js-sdk';
import { errorTracing } from '../lib/utils';
import * as R from 'ramda';
MatrixApi
has 63 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class MatrixApi extends BaseChatApi implements MessengerApi {
userId: string;
baseUrl: string;
// matrix client
client: any;
File types.ts
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Project, Selectors } from '../../types';
import { KeyType } from './selectors';
export interface GitlabUserData extends GitlabUserDataShort {
access_level: number;
File index.ts
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { BaseChatApi } from '../messengers/base-api';
import { GitlabPushCommit, GitlabPipeline, GitlabLabelHook } from '../task-trackers/gitlab/types';
export interface DefaultLabel {
name: string;
File index.ts
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { setupCache } from 'axios-cache-adapter';
import { Projects } from '@gitbeaker/node';
import * as R from 'ramda';
import axios, { AxiosRequestConfig, AxiosInstance } from 'axios';
import querystring from 'querystring';
File selectors.ts
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { differenceBy, union, groupBy, mapValues } from 'lodash';
import {
GitlabIssueHook,
GitlabCommentHook,
HookTypes,
Jira
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Jira implements TaskTracker {
url: string;
user: string;
password: string;
inviteIgnoreUsers: string[];
File index.ts
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import axios, { AxiosRequestConfig } from 'axios';
import querystring from 'querystring';
import * as R from 'ramda';
import { getLogger } from '../../modules/log';
import * as messages from '../../lib/messages';
SlackApi
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class SlackApi extends BaseChatApi {
// export class SlackApi extends BaseChatApi {
commandServer;
count = 0;
client: any;
Gitlab
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Gitlab implements TaskTracker {
private slashCommandsList = [
'/approve',
'/assign',
'/assign',
File types.ts
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Selectors, Issue, Project } from '../../types';
interface UserData {
self: string;
avatarUrls: {
ChatFasade
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class ChatFasade {
chatPool: MessengerApi[];
worker: MessengerApi;
constructor(chatPool: Array<MessengerApi>) {
Function run
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async run({ bodyText = '', sender, roomData }: CommandOptions) {
const { alias, id } = roomData;
if (!alias) {
return translate('noAlias');
}
File slack-api.ts
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-undefined */
import http from 'http';
import Ramda from 'ramda';
import { WebClient } from '@slack/web-api';
import { fromString } from 'html-to-text';
Function getServer
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getServer: getServerType = (handleFunc, hookParser): express.Application => {
app.use(
bodyParser.json({
strict: false,
limit: '20mb',
Function run
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async run({
newStatusId,
author,
changes,
oldKey,
Function run
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
async run({
newStatusId,
author,
changes,
oldKey,
- 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 handleRedisData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
async handleRedisData(dataFromRedis) {
try {
if (!dataFromRedis) {
logger.warn('No data from redis');
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function run
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async run({ bodyText, sender, roomData }: CommandOptions) {
if (!roomData.alias) {
throw new Error('Not issue room');
}