Showing 8 of 15 total issues
Consider simplifying this complex logical expression. Open
Open
} else if (isDataRow(row)) {
results.data.at(-1)?.items.push({
itemNumber: row[0] ?? '',
itemName: row[1] ?? '',
binLocation: row[3] ?? '',
Function parseFasterCsvReport
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function parseFasterCsvReport<T>(
pathToCsvFile: string,
parsingOptions: ParseFasterCsvReportOptions<T>
): Promise<FasterCsvReportResults<T>> {
// eslint-disable-next-line security/detect-non-literal-fs-filename
Function parseW311ExcelReport
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function parseW311ExcelReport(
pathToXlsxFile: string
): W311ExcelReportResults {
const workbook = getXLSXWorkBook(pathToXlsxFile)
Function extractReportMetadata
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function extractReportMetadata(
workbook: XLSX.WorkBook,
options: ExtractReportMetadataOptions
): FasterExcelReportResults {
const lastSheet = workbook.Sheets[workbook.SheetNames.at(-1) as string]
Function parseW200ExcelReport
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function parseW200ExcelReport(
pathToXlsxFile: string
): W200ExcelReportResults {
const workbook = getXLSXWorkBook(pathToXlsxFile)
Function step
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
step: (row) => {
const rawRowDataList = row.data as unknown as string[]
if (headerArray === undefined) {
headerArray = rawRowDataList
Function extractReportMetadata
has a Cognitive Complexity of 17 (exceeds 10 allowed). Consider refactoring. Open
Open
export function extractReportMetadata(
workbook: XLSX.WorkBook,
options: ExtractReportMetadataOptions
): FasterExcelReportResults {
const lastSheet = workbook.Sheets[workbook.SheetNames.at(-1) as 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 parseW311ExcelReport
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
Open
export function parseW311ExcelReport(
pathToXlsxFile: string
): W311ExcelReportResults {
const workbook = getXLSXWorkBook(pathToXlsxFile)
- 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"