piobyte/flamingo

View on GitHub

Showing 52 of 52 total issues

Function fn has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            fn: function (deferred: Deferred) {
              const op = new FlamingoOperation();
              op.input = PARSED_HOST;
              op.config = {
                ACCESS: { HTTPS: { ENABLED: false } },
Severity: Minor
Found in packages/flamingo/targets/bench/suites/convert-remote.ts - About 1 hr to fix

    Function debug-preview-image has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      "debug-preview-image"(request, config): Promise<ProfileInstruction> {
        const dim = clamp(
          envParser.objectInt("width", 200)(request.query),
          10,
          1024
    Severity: Minor
    Found in packages/flamingo/src/profiles/debug.ts - About 1 hr to fix

      Function debug-avatar-image has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        "debug-avatar-image"(request, config): Promise<ProfileInstruction> {
          const dim = clamp(
            envParser.objectInt("width", 200)(request.query),
            10,
            1024
      Severity: Minor
      Found in packages/flamingo/src/profiles/debug.ts - About 1 hr to fix

        Function storeResults has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function storeResults(
          suite: Suite & { name: string },
          suiteName: string,
          profileName: string
        ) {
        Severity: Minor
        Found in packages/flamingo/targets/bench/index.ts - About 1 hr to fix

          Function videoProcessor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function videoProcessor(input: stream.Readable): Promise<stream.Readable> {
                return new Promise(function (resolve, reject) {
                  ffmpeg.ffprobe(input, function (err: Error, meta: any) {
                    if (err) {
                      reject(new InvalidInputError(err.message, err));
          Severity: Minor
          Found in packages/flamingo/src/preprocessor/video/index.ts - About 1 hr to fix

            Function constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(
                config: Config = {},
                method: Hapi.Util.HTTP_METHODS_PARTIAL = "GET",
                path = "/_debug",
                description = "Debug"
            Severity: Minor
            Found in packages/flamingo/src/routes/debug.ts - About 1 hr to fix

              Function extractDimension has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function extractDimension(
                query: Record<string, any> = {},
                defaultSize: number
              ) {
                let width;
              Severity: Minor
              Found in packages/flamingo/src/profiles/examples.ts - About 1 hr to fix

                Function S3Mixin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export = function S3Mixin<T extends Constructor<Route>>(SuperClass: T) {
                  /**
                   * Mixin that adds a video preprocessor which creates an image from a given video
                   * @mixin
                   */
                Severity: Minor
                Found in packages/flamingo-s3/src/mixin.ts - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  class Image extends ImageStream(ProfileOperation(Convert(Route))) {
                    /**
                     *
                     * @param {Config} conf
                     * @param {string} [method='GET']
                  Severity: Major
                  Found in packages/flamingo/src/routes/image.ts and 1 other location - About 1 hr to fix
                  packages/flamingo/src/routes/video.ts on lines 15..31

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  class Video extends VideoPreprocess(Image) {
                    /**
                     *
                     * @param {Config} conf
                     * @param {string} [method='GET']
                  Severity: Major
                  Found in packages/flamingo/src/routes/video.ts and 1 other location - About 1 hr to fix
                  packages/flamingo/src/routes/image.ts on lines 18..34

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  const httpsReader: Reader = function (
                    operation: FlamingoOperation
                  ): Promise<ReaderResult> {
                    const conf = operation.config;
                    const input = operation.input;
                  Severity: Minor
                  Found in packages/flamingo/src/reader/https.ts - About 1 hr to fix

                    Function convertLocal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function convertLocal(profileName: string) {
                          return new Promise(function (resolve) {
                            const gmOptions = { DEFAULT_MIME: "image/png" };
                            const gmRequest = { headers: {}, query: { processor: "gm" } };
                            const vipsOptions = { DEFAULT_MIME: "image/png" };
                    Severity: Minor
                    Found in packages/flamingo/targets/bench/suites/convert-local.ts - About 1 hr to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        "convert-local":
                          // eslint-disable-next-line @typescript-eslint/no-var-requires
                          require("./suites/convert-local")({
                            temp: temp,
                            imageProcessors: imageProcessors,
                      Severity: Major
                      Found in packages/flamingo/targets/bench/index.ts and 1 other location - About 1 hr to fix
                      packages/flamingo/targets/bench/index.ts on lines 106..117

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 56.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        "convert-remote":
                          // eslint-disable-next-line @typescript-eslint/no-var-requires
                          require("./suites/convert-remote")({
                            temp: temp,
                            cycle: cycleFn,
                      Severity: Major
                      Found in packages/flamingo/targets/bench/index.ts and 1 other location - About 1 hr to fix
                      packages/flamingo/targets/bench/index.ts on lines 94..105

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 56.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              new Benchmark.Suite(description)
                                .add("GM", {
                                  defer: true,
                                  fn: function (deferred: Deferred) {
                                    suiteConfig.profiles[profileName](gmRequest, gmOptions).then(
                      Severity: Minor
                      Found in packages/flamingo/targets/bench/suites/convert-local.ts and 1 other location - About 55 mins to fix
                      packages/flamingo/targets/bench/suites/convert-local.ts on lines 46..62

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          suiteConfig.convertProfiles.forEach(function (name: string) {
                            prom = prom.then(function () {
                              return convertRemote(name);
                            });
                          });
                      Severity: Minor
                      Found in packages/flamingo/targets/bench/suites/convert-remote.ts and 1 other location - About 50 mins to fix
                      packages/flamingo/targets/bench/suites/convert-local.ts on lines 70..74

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 52.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          suiteConfig.convertProfiles.forEach(function (name: string) {
                            prom = prom.then(function () {
                              return convertLocal(name);
                            });
                          });
                      Severity: Minor
                      Found in packages/flamingo/targets/bench/suites/convert-local.ts and 1 other location - About 50 mins to fix
                      packages/flamingo/targets/bench/suites/convert-remote.ts on lines 157..161

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 52.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                    op.config = {
                                      ACCESS: { HTTPS: { ENABLED: false } },
                                      ALLOW_READ_REDIRECT: false,
                                      READER: { REQUEST: { TIMEOUT: 2000 } },
                                    };
                      Severity: Major
                      Found in packages/flamingo/targets/bench/suites/convert-remote.ts and 2 other locations - About 50 mins to fix
                      packages/flamingo/targets/bench/suites/convert-remote.ts on lines 101..105
                      packages/flamingo/targets/formats/index.ts on lines 82..86

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 51.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                    op.config = {
                                      ACCESS: { HTTPS: { ENABLED: false } },
                                      ALLOW_READ_REDIRECT: false,
                                      READER: { REQUEST: { TIMEOUT: 2000 } },
                                    };
                      Severity: Major
                      Found in packages/flamingo/targets/bench/suites/convert-remote.ts and 2 other locations - About 50 mins to fix
                      packages/flamingo/targets/bench/suites/convert-remote.ts on lines 47..51
                      packages/flamingo/targets/formats/index.ts on lines 82..86

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 51.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                            op.config = {
                              ACCESS: { HTTPS: { ENABLED: false } },
                              ALLOW_READ_REDIRECT: false,
                              READER: { REQUEST: { TIMEOUT: 3000 } },
                            };
                      Severity: Major
                      Found in packages/flamingo/targets/formats/index.ts and 2 other locations - About 50 mins to fix
                      packages/flamingo/targets/bench/suites/convert-remote.ts on lines 47..51
                      packages/flamingo/targets/bench/suites/convert-remote.ts on lines 101..105

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 51.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language