cherfia/chromiumly

View on GitHub

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) {
Severity: Major
Found in src/chromium/utils/converter.utils.ts - About 2 hrs to fix

    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) {
    Severity: Major
    Found in src/chromium/utils/converter.utils.ts - About 2 hrs to fix

      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) {
      Severity: Minor
      Found in src/chromium/utils/converter.utils.ts - About 1 hr to fix

      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) {
      Severity: Minor
      Found in src/chromium/utils/screenshot.utils.ts - About 1 hr to fix

        Function convert has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async convert({
                html,
                assets,
                header,
                footer,
        Severity: Minor
        Found in src/chromium/converters/html.converter.ts - About 1 hr to fix

          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) {
          Severity: Minor
          Found in src/chromium/utils/converter.utils.ts - About 1 hr to fix

          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) {
          Severity: Minor
          Found in src/chromium/utils/screenshot.utils.ts - About 1 hr to fix

          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,
          Severity: Minor
          Found in src/chromium/screenshots/html.screenshot.ts - About 1 hr to fix

            Function addPageProperties has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static addPageProperties(
                    data: FormData,
                    pageProperties: PageProperties
                ): void {
                    if (pageProperties.landscape) {
            Severity: Minor
            Found in src/libre-office/utils/libre-office.utils.ts - About 1 hr to fix

              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);
              Severity: Minor
              Found in src/chromium/utils/screenshot.utils.ts - About 1 hr to fix

                Function convert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    async convert({
                        url,
                        header,
                        footer,
                        properties,
                Severity: Minor
                Found in src/chromium/converters/url.converter.ts - About 1 hr to fix

                  Function convert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      async convert({
                          html,
                          markdown,
                          header,
                          footer,
                  Severity: Minor
                  Found in src/chromium/converters/markdown.converter.ts - About 1 hr to fix

                    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()) {
                    Severity: Minor
                    Found in src/pdf-engines/utils/pdf-engines.utils.ts - About 55 mins to fix

                    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);
                    Severity: Minor
                    Found in src/chromium/utils/screenshot.utils.ts - About 25 mins to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language