buttercup-pw/buttercup-core

View on GitHub
source/io/VaultFormatA.ts

Summary

Maintainability
F
6 days
Test Coverage

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

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

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

    export default class VaultFormatA extends VaultFormat {
        static encodeRaw(rawContent: History, credentials: Credentials): Promise<string> {
            const compress = getSharedAppEnv().getProperty("compression/v1/compressText");
            const encrypt = getSharedAppEnv().getProperty("crypto/v1/encryptText");
            const { masterPassword } = getCredentials(credentials.id);
    Severity: Major
    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 28 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 = /^\$([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/.exec(currentCommand);
      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 encodeRaw(rawContent: History, credentials: Credentials): Promise<string> {
                const compress = getSharedAppEnv().getProperty("compression/v1/compressText");
                const encrypt = getSharedAppEnv().getProperty("crypto/v1/encryptText");
                const { masterPassword } = getCredentials(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 40..49

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

        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 216..222

        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 452..460
        source/io/VaultFormatA.ts on lines 462..470

        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 442..450
        source/io/VaultFormatA.ts on lines 452..460

        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 442..450
        source/io/VaultFormatA.ts on lines 462..470

        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

            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 208..215
        source/io/VaultFormatA.ts on lines 217..224
        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 208..215
        source/io/VaultFormatA.ts on lines 217..224
        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

            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 217..224
        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

            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 208..215
        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

            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 234..241
        source/io/VaultFormatA.ts on lines 243..250
        source/io/VaultFormatA.ts on lines 260..267

        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 243..250
        source/io/VaultFormatA.ts on lines 260..267
        source/io/VaultFormatA.ts on lines 472..479

        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 234..241
        source/io/VaultFormatA.ts on lines 243..250
        source/io/VaultFormatA.ts on lines 472..479

        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 234..241
        source/io/VaultFormatA.ts on lines 260..267
        source/io/VaultFormatA.ts on lines 472..479

        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 71..82

        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 226..232

        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 252..258

        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

            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 301..303

        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

            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 297..299

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

                this.execute(
                    Inigo.create(Inigo.Command.Format)
                        .addArgument(getFormat())
                        .generateCommand()
                );
        Severity: Minor
        Found in source/io/VaultFormatA.ts and 1 other location - About 30 mins to fix
        source/io/VaultFormatA.ts on lines 329..333

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

        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

                this.execute(
                    Inigo.create(Inigo.Command.ArchiveID)
                        .addArgument(generateUUID())
                        .generateCommand()
                );
        Severity: Minor
        Found in source/io/VaultFormatA.ts and 1 other location - About 30 mins to fix
        source/io/VaultFormatA.ts on lines 409..413

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

        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