Showing 8 of 32 total issues
File pagedHttpGetReader.ts
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Copyright (C) 2017-2019 Brainbean Apps OU (https://brainbeanapps.com).
// License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import _ from 'lodash'
import { Readable } from 'stream'
Function onRequestResponse
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onRequestResponse(response: any): void {
logger.log(
'debug',
`Received response while making paged HTTP GET request to ${this.url}`,
)
Function onRequestResponse
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onRequestResponse(response: any): void {
logger.log(
'debug',
`Received response while making HTTP GET request to ${this.url}`,
)
File httpGetReader.ts
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Copyright (C) 2017-2019 Brainbean Apps OU (https://brainbeanapps.com).
// License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import _ from 'lodash'
import { Readable } from 'stream'
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(url: string | URL, nextPage: any, options: any = undefined) {
options = Object.assign(
{},
{
transformFactory: undefined,
Function proceedToNextPage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private proceedToNextPage(data: any): void {
this.detachFromStreams()
logger.log(
'verbose',
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(url: string | URL, options: any = undefined) {
options = Object.assign(
{},
{
transform: undefined,
Function onRequestResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private onRequestResponse(response: any): void {
logger.log(
'debug',
`Received response while making paged HTTP GET request to ${this.url}`,
)
- 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"