Showing 29 of 64 total issues
Function myHandler
has 109 lines of code (exceeds 40 allowed). Consider refactoring. Open
async function myHandler() {
const cluster = process.env.cluster;
const RUNNING = "RUNNING";
const connectors: {
name: string;
Function myHandler
has 85 lines of code (exceeds 40 allowed). Consider refactoring. Open
async function myHandler(
event: { value: string; key: string },
_context: any,
_callback: Function
) {
File connect-lib.ts
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as ecs from "./ecs-lib.js";
import {
ECSClient,
DescribeTasksCommand,
ListTasksCommand,
Function handler
has 76 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (
event: { Payload: any },
_context: any,
callback: Function
) {
Function myHandler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
async function myHandler() {
const cluster = process.env.cluster;
const RUNNING = "RUNNING";
const connectors: {
name: string;
- 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 handler
has 70 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (
event: { Payload: any },
_context: any,
callback: Function
) {
File run.ts
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import yargs from "yargs";
import * as dotenv from "dotenv";
import LabeledProcessRunner from "./runner.js";
import * as fs from "fs";
import { ServerlessStageDestroyer } from "@stratiformdigital/serverless-stage-destroyer";
Function handler
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.handler = async function (
event: { Payload: any },
_context: any,
callback: Function
) {
- 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 handler
has 56 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (event: {
Records: { dynamodb: { Keys: { PK: { S: string }; SK: { S: string } } } }[];
}) {
console.log("Received event:", JSON.stringify(event, null, 2));
const client = new SFNClient({ region: process.env.region });
Function getMeanTimeToRecover
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getMeanTimeToRecover = async (branch: string) => {
const response = await octokit.paginate(
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
{
owner: "Enterprise-CMCS",
- 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 handler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.handler = async function (event: {
Records: { dynamodb: { Keys: { PK: { S: string }; SK: { S: string } } } }[];
}) {
console.log("Received event:", JSON.stringify(event, null, 2));
const client = new SFNClient({ region: process.env.region });
- 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 handler
has 50 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (event: {
Records: { dynamodb: { Keys: { SK: { S: string }; PK: { S: string } } } }[];
}) {
console.log("Received event:", JSON.stringify(event, null, 2));
const client = new SFNClient({ region: process.env.region });
Function handler
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.handler = async function (event: {
Records: { dynamodb: { Keys: { SK: { S: string }; PK: { S: string } } } }[];
}) {
console.log("Received event:", JSON.stringify(event, null, 2));
const client = new SFNClient({ region: process.env.region });
- 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 handler
has 46 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (event: { recipient: string; days: number }) {
console.log("Received event:", JSON.stringify(event, null, 2));
const { recipient, days } = event;
Function myHandler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function myHandler(
event: { value: string; key: string },
_context: any,
_callback: Function
) {
- 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 getMeanTimeToRecover
has 42 lines of code (exceeds 40 allowed). Consider refactoring. Open
export const getMeanTimeToRecover = async (branch: string) => {
const response = await octokit.paginate(
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
{
owner: "Enterprise-CMCS",
Function findIpForEcsService
has 42 lines of code (exceeds 40 allowed). Consider refactoring. Open
export async function findIpForEcsService(cluster: string | undefined) {
try {
const client = new ECSClient({});
const listStacksCommandResponse = await client.send(
new ListTasksCommand({
Function handler
has 41 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (
event: CloudFormationCustomResourceEvent,
_context: any
) {
console.log("Request:", JSON.stringify(event, undefined, 2));
Function handler
has 41 lines of code (exceeds 40 allowed). Consider refactoring. Open
exports.handler = async function (
event: CloudFormationCustomResourceEvent,
_context: any
) {
console.log("Request:", JSON.stringify(event, undefined, 2));
Function handler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.handler = async function (
event: { Payload: any },
_context: any,
callback: Function
) {
- 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"