elninotech/uppload

View on GitHub

Showing 72 of 92 total issues

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

export const fr = {
  upload: "Télécharger",
  cancel: "Annuler",
  close: "Fermer",
  uploading: "Télécharger...",
Severity: Major
Found in src/i18n/fr.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const uk = {
  upload: "Завантажити",
  cancel: "Відмінити",
  close: "Закрити",
  uploading: "Завантаження...",
Severity: Major
Found in src/i18n/uk.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const pt = {
  upload: "Enviar",
  cancel: "Cancelar",
  close: "Fechar",
  uploading: "Enviando...",
Severity: Major
Found in src/i18n/pt.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const tr = {
  upload: "Yükleme",
  cancel: "İptal etmek",
  close: "Kapat",
  uploading: "Yükle ...",
Severity: Major
Found in src/i18n/tr.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const it = {
  upload: "Caricare",
  cancel: "Annulla",
  close: "Vicino",
  uploading: "Carica ...",
Severity: Major
Found in src/i18n/it.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const fa = {
    upload: "آپلود",
    cancel: "لغو",
    close: "بستن",
    uploading: "در حال بارگذاری...",
Severity: Major
Found in src/i18n/fa.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const zhTW = {
  upload: "上載",
  cancel: "取消",
  close: "關",
  uploading: "上傳中...",
Severity: Major
Found in src/i18n/zh-TW.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const ro = {
  upload: "Încărcare",
  cancel: "Anulare",
  close: "Închide",
  uploading: "Încărcare...",
Severity: Major
Found in src/i18n/ro.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const es = {
  upload: "Subir",
  cancel: "Cancelar",
  close: "Cerrar",
  uploading: "Subiendo...",
Severity: Major
Found in src/i18n/es.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const de = {
  upload: "Hochladen",
  cancel: "Abbrechen",
  close: "Schließen",
  uploading: "Hochladen ...",
Severity: Major
Found in src/i18n/de.ts and 11 other locations - About 4 days to fix
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const hi = {
  upload: "अपलोड",
  cancel: "रद्द करना",
  close: "बंद करे",
  uploading: "अपलोड हो रहा है...",
Severity: Major
Found in src/i18n/hi.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/it.ts on lines 1..186
src/i18n/nl.ts on lines 1..185
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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 12 locations. Consider refactoring.
Open

export const nl = {
  upload: "Uploaden",
  cancel: "Annuleren",
  close: "Sluiten",
  uploading: "Uploaden...",
Severity: Major
Found in src/i18n/nl.ts and 11 other locations - About 4 days to fix
src/i18n/de.ts on lines 1..184
src/i18n/es.ts on lines 1..189
src/i18n/fa.ts on lines 1..188
src/i18n/fr.ts on lines 1..186
src/i18n/hi.ts on lines 1..184
src/i18n/it.ts on lines 1..186
src/i18n/pt.ts on lines 1..189
src/i18n/ro.ts on lines 1..189
src/i18n/tr.ts on lines 1..184
src/i18n/uk.ts on lines 1..189
src/i18n/zh-TW.ts on lines 1..189

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 732.

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

File uppload.ts has 702 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { UpploadService } from "./service";
import { UpploadEffect } from "./effect";
import { setI18N, translate } from "./helpers/i18n";
import { compressImage, getElements, safeListen } from "./helpers/elements";
import { colorSVG } from "./helpers/assets";
Severity: Major
Found in src/uppload.ts - About 1 day to fix

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

        requestAnimationFrame(() => {
          if (typeof activeService.handlers === "function")
            activeService.handlers({
              next: this.next.bind(this),
              upload: this.upload.bind(this),
    Severity: Major
    Found in src/uppload.ts and 1 other location - About 4 hrs to fix
    src/uppload.ts on lines 507..518

    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 133.

    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

        requestAnimationFrame(() => {
          if (typeof activeEffect.handlers === "function")
            activeEffect.handlers({
              next: this.next.bind(this),
              upload: this.upload.bind(this),
    Severity: Major
    Found in src/uppload.ts and 1 other location - About 4 hrs to fix
    src/uppload.ts on lines 477..488

    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 133.

    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

    Uppload has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Uppload implements IUppload {
      services: UpploadService[] = [new DefaultService(), new UploadingService()];
      effects: UpploadEffect[] = [];
      isOpen = false;
      error?: string;
    Severity: Minor
    Found in src/uppload.ts - About 4 hrs to fix

      Function handlers has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private handlers() {
          const openFunction = () => this.open();
          const closeFunction = () => this.close();
      
          /**
      Severity: Major
      Found in src/uppload.ts - About 3 hrs to fix

        Function canvasToBlob has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        export const canvasToBlob = (
          canvas: HTMLCanvasElement,
          type?: string,
          quality?: number
        ): Promise<Blob> => {
        Severity: Minor
        Found in src/helpers/elements.ts - About 2 hrs 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 update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

          private update() {
            if (!this.container) return;
            this.hideHelp();
            if (this.settings.customClass)
              this.container.classList.add(this.settings.customClass);
        Severity: Minor
        Found in src/uppload.ts - About 2 hrs 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

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

                    this.lang.effects &&
                    this.lang.effects[effect.name] &&
                    this.lang.effects[effect.name].title
                      ? this.lang.effects[effect.name].title
                      : effect.name
        Severity: Major
        Found in src/uppload.ts and 1 other location - About 2 hrs to fix
        src/uppload.ts on lines 357..361

        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 83.

        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