Showing 110 of 172 total issues
Avoid too many return
statements within this function. Open
return translate('setBotToAdmin', { projectKey, viewUrl });
Avoid too many return
statements within this function. Open
return translate('successProjectAddToArchiveWithStatus', { projectKey, activeTime: month, status });
Avoid too many return
statements within this function. Open
return [successExportMsg, msg].join('<br>');
Function getGroupedUsers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getGroupedUsers = (
members: { userId: string; powerLevel: number }[],
botId: string,
): { simpleUsers: string[]; admins: string[]; bot: string[] } => {
const getGroup = (user: { userId: string; powerLevel: number }) => {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
async run({ key, typeName, projectKey }: InviteNewMembersData): Promise<string[] | false> {
const {
messenger: { bots },
} = this.config;
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 handleRedisRooms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async handleRedisRooms(roomsData) {
const roomHandle = async (data: CreateRoomData) => {
try {
await this.actions.run(ActionNames.CreateRoom, data);
- 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 getIssueForSearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getIssueForSearch(keyOrKeys: string | string[]): Promise<Issue> {
if (Array.isArray(keyOrKeys)) {
const res = await Promise.all(
keyOrKeys.map(async key => {
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 parseTextBody
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseTextBody(body: string): SuccessParse | FailParse {
try {
const trimedBody = body.trim();
const commandNameFromUser = R.pipe(
- 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 getMilestoneId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getMilestoneId: body => {
const isMilestoneDeleted = data => {
const changes = handlers.issue.getIssueChanges(data);
if (changes) {
const newMilestone = changes.find(el => el.field === 'milestone_id');
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
async run(
commandName: string | CommandNames,
{ chatApi, roomData, roomId, roomName, sender, bodyText, url, senderDisplayName }: RunCommandsOptions,
) {
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"