buttercup-pw/buttercup-core

View on GitHub
source/io/VaultFormatA.ts

Summary

Maintainability
F
6 days
Test Coverage

File VaultFormatA.ts has 483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Layerr } from "layerr";
import { VaultFormat } from "./VaultFormat.js";
import { Vault } from "../core/Vault.js";
import { Credentials } from "../credentials/Credentials.js";
import {
Severity: Minor
Found in source/io/VaultFormatA.ts - About 7 hrs to fix

    VaultFormatA has 50 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class VaultFormatA extends VaultFormat {
        static async encodeRaw(rawContent: History, credentials: Credentials): Promise<string> {
            const compress = getSharedAppEnv().getProperty("compression/v1/compressText");
            const encrypt = getSharedAppEnv().getProperty("crypto/v1/encryptText");
            const masterPassword = getMasterPassword(credentials.id);
    Severity: Minor
    Found in source/io/VaultFormatA.ts - About 7 hrs to fix

      Function findGroupContainingGroupID has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          findGroupContainingGroupID(id: GroupID): FormatAGroup {
              const searchGroups = (groups: Array<FormatAGroup>): FormatAGroup => {
                  for (const group of groups) {
                      if (group.id === id) return null;
                      const children = group.groups || [];
      Severity: Minor
      Found in source/io/VaultFormatA.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 _executeCommand has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _executeCommand(command: string) {
              let currentCommand = command,
                  shareID = null;
              if (SHARE_COMMAND_EXP.test(currentCommand)) {
                  const shareMatch =
      Severity: Minor
      Found in source/io/VaultFormatA.ts - About 1 hr to fix

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

            static async encodeRaw(rawContent: History, credentials: Credentials): Promise<string> {
                const compress = getSharedAppEnv().getProperty("compression/v1/compressText");
                const encrypt = getSharedAppEnv().getProperty("crypto/v1/encryptText");
                const masterPassword = getMasterPassword(credentials.id);
                return Promise.resolve()
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 4 hrs to fix
        source/io/VaultFormatB.ts on lines 51..60

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

        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

            findGroupContainingEntryID(id: EntryID): FormatAGroup {
                const matchingEntry = this.getAllEntries().find((entry) => entry.id === id);
                if (matchingEntry) {
                    return this.getAllGroups().find((group) => group.id === matchingEntry.parentID) || null;
                }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 3 hrs to fix
        source/io/VaultFormatB.ts on lines 234..240

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

        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

            setEntryAttribute(entryID: EntryID, attribute: string, value: string) {
                this.execute(
                    Inigo.create(Inigo.Command.SetEntryAttribute)
                        .addArgument(entryID)
                        .addArgument(attribute)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 2 other locations - About 2 hrs to fix
        source/io/VaultFormatA.ts on lines 453..461
        source/io/VaultFormatA.ts on lines 463..471

        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

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

            setGroupAttribute(groupID: GroupID, attribute: string, value: string) {
                this.execute(
                    Inigo.create(Inigo.Command.SetGroupAttribute)
                        .addArgument(groupID)
                        .addArgument(attribute)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 2 other locations - About 2 hrs to fix
        source/io/VaultFormatA.ts on lines 443..451
        source/io/VaultFormatA.ts on lines 453..461

        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

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

            setEntryProperty(entryID: EntryID, property: string, value: string) {
                this.execute(
                    Inigo.create(Inigo.Command.SetEntryProperty)
                        .addArgument(entryID)
                        .addArgument(property)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 2 other locations - About 2 hrs to fix
        source/io/VaultFormatA.ts on lines 443..451
        source/io/VaultFormatA.ts on lines 463..471

        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

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

            createEntry(groupID: GroupID, entryID: EntryID) {
                this.execute(
                    Inigo.create(Inigo.Command.CreateEntry)
                        .addArgument(groupID)
                        .addArgument(entryID)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 220..227
        source/io/VaultFormatA.ts on lines 417..424
        source/io/VaultFormatA.ts on lines 426..433

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

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

            moveEntry(entryID: EntryID, groupID: GroupID) {
                this.execute(
                    Inigo.create(Inigo.Command.MoveEntry)
                        .addArgument(entryID)
                        .addArgument(groupID)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 211..218
        source/io/VaultFormatA.ts on lines 220..227
        source/io/VaultFormatA.ts on lines 426..433

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

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

            createGroup(parentID: GroupID, groupID: GroupID) {
                this.execute(
                    Inigo.create(Inigo.Command.CreateGroup)
                        .addArgument(parentID)
                        .addArgument(groupID)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 211..218
        source/io/VaultFormatA.ts on lines 417..424
        source/io/VaultFormatA.ts on lines 426..433

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

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

            moveGroup(groupID: GroupID, newParentID: GroupID) {
                this.execute(
                    Inigo.create(Inigo.Command.MoveGroup)
                        .addArgument(groupID)
                        .addArgument(newParentID)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 211..218
        source/io/VaultFormatA.ts on lines 220..227
        source/io/VaultFormatA.ts on lines 417..424

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

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

            setGroupTitle(groupID: GroupID, title: string) {
                this.execute(
                    Inigo.create(Inigo.Command.SetGroupTitle)
                        .addArgument(groupID)
                        .addArgument(title)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 235..242
        source/io/VaultFormatA.ts on lines 244..251
        source/io/VaultFormatA.ts on lines 259..266

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

        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

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

                return Promise.resolve()
                    .then(() => {
                        if (!hasValidSignature(encryptedContent)) {
                            throw new Error("No valid signature in vault");
                        }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 1 hr to fix
        source/io/VaultFormatB.ts on lines 82..93

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

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

            deleteGroupAttribute(groupID: GroupID, attribute: string) {
                this.execute(
                    Inigo.create(Inigo.Command.DeleteGroupAttribute)
                        .addArgument(groupID)
                        .addArgument(attribute)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 235..242
        source/io/VaultFormatA.ts on lines 244..251
        source/io/VaultFormatA.ts on lines 473..480

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

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

            deleteEntryAttribute(entryID: EntryID, attribute: string) {
                this.execute(
                    Inigo.create(Inigo.Command.DeleteEntryAttribute)
                        .addArgument(entryID)
                        .addArgument(attribute)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 244..251
        source/io/VaultFormatA.ts on lines 259..266
        source/io/VaultFormatA.ts on lines 473..480

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

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

            deleteEntryProperty(entryID: EntryID, property: string) {
                this.execute(
                    Inigo.create(Inigo.Command.DeleteEntryProperty)
                        .addArgument(entryID)
                        .addArgument(property)
        Severity: Major
        Found in source/io/VaultFormatA.ts and 3 other locations - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 235..242
        source/io/VaultFormatA.ts on lines 259..266
        source/io/VaultFormatA.ts on lines 473..480

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

        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

            deleteGroup(groupID: GroupID) {
                this.execute(
                    Inigo.create(Inigo.Command.DeleteGroup).addArgument(groupID).generateCommand()
                );
            }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 229..233

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

        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

            deleteEntry(entryID: EntryID) {
                this.execute(
                    Inigo.create(Inigo.Command.DeleteEntry).addArgument(entryID).generateCommand()
                );
            }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 253..257

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

        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

            findGroupByID(id: GroupID): FormatAGroup {
                return this.getAllGroups().find((group) => group.id === id) || null;
            }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 296..298

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

        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

            findEntryByID(id: EntryID): FormatAEntry {
                return this.getAllEntries().find((entry) => entry.id === id) || null;
            }
        Severity: Major
        Found in source/io/VaultFormatA.ts and 1 other location - About 1 hr to fix
        source/io/VaultFormatA.ts on lines 300..302

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

        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

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

            erase() {
                super.erase();
                Object.assign(this.source, emptyVault());
                this.emit("erased");
            }
        Severity: Minor
        Found in source/io/VaultFormatA.ts and 1 other location - About 40 mins to fix
        source/io/VaultFormatB.ts on lines 203..207

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

        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

                if (!hasFormatted) {
                    this.execute(
                        Inigo.create(Inigo.Command.Format).addArgument(getFormat()).generateCommand()
                    );
                }
        Severity: Minor
        Found in source/io/VaultFormatA.ts and 1 other location - About 40 mins to fix
        source/io/VaultFormatA.ts on lines 327..331

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

        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

            generateID() {
                this.execute(
                    Inigo.create(Inigo.Command.ArchiveID).addArgument(generateUUID()).generateCommand()
                );
            }
        Severity: Minor
        Found in source/io/VaultFormatA.ts and 1 other location - About 40 mins to fix
        source/io/VaultFormatA.ts on lines 407..411

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

        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

        There are no issues that match your filters.

        Category
        Status