Showing 14 of 32 total issues
Function addPageProperties
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static addPageProperties(
data: FormData,
pageProperties: PageProperties
): void {
if (pageProperties.singlePage) {
Function customize
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static async customize(
data: FormData,
options: ConversionOptions
): Promise<void> {
if (options.pdfFormat) {
Function customize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static async customize(
data: FormData,
options: ConversionOptions
): Promise<void> {
if (options.pdfFormat) {
- 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 customize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static async customize(
data: FormData,
options: ScreenshotOptions
): Promise<void> {
if (options.header) {
Function convert
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
async convert({
html,
assets,
header,
footer,
Function addPageProperties
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static addPageProperties(
data: FormData,
pageProperties: PageProperties
): void {
if (pageProperties.singlePage) {
- 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 customize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static async customize(
data: FormData,
options: ScreenshotOptions
): Promise<void> {
if (options.header) {
- 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 capture
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async capture({
html,
assets,
header,
footer,
Function addPageProperties
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static addPageProperties(
data: FormData,
pageProperties: PageProperties
): void {
if (pageProperties.landscape) {
Function addImageProperties
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static addImageProperties(
data: FormData,
imageProperties: ImageProperties
): void {
data.append('format', imageProperties.format);
Function convert
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async convert({
url,
header,
footer,
properties,
Function convert
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async convert({
html,
markdown,
header,
footer,
Function addFiles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static async addFiles(
files: PathLikeOrReadStream[],
data: FormData
) {
for (const [key, file] of files.entries()) {
- 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 addImageProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static addImageProperties(
data: FormData,
imageProperties: ImageProperties
): void {
data.append('format', imageProperties.format);
- 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"