jcgertig/betterstorage

View on GitHub

Showing 4 of 14 total issues

BetterStorage has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

@autobind
export default class BetterStorage {
  constructor(prefix = '', kind = 'local', overrides = {}) {
    this.prefix = prefix;
    this.kind = kind;
Severity: Minor
Found in src/BetterStorage.js - About 2 hrs to fix

    BetterStorageAsync has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @autobind
    export default class BetterStorageAsync {
      constructor(prefix = '', kind = 'local', overrides = {}) {
        this.prefix = prefix;
        this.kind = kind;
    Severity: Minor
    Found in src/BetterStorageAsync.js - About 2 hrs to fix

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

        setKind(kind, migrateData = false) {
          return new Promise((accept, reject) => {
            const newStore = typeof kind === 'string' ? window[`${kind}Storage`] : kind;
            if (migrateData && this.prefix !== '' && this.keys.length > 0) {
              this.keys
      Severity: Minor
      Found in src/BetterStorageAsync.js - About 1 hr to fix

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

          setPrefix(prefix = '', changeExisting = false) {
            return new Promise((accept, reject) => {
              if (changeExisting && this.prefix !== '' && this.keys.length > 0) {
                this.keys
                .then((keys) => {
        Severity: Minor
        Found in src/BetterStorageAsync.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language