leafjs/orient

View on GitHub
src/document.js

Summary

Maintainability
B
5 hrs
Test Coverage

Document has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class Document extends EventEmitter {
    constructor(model, properties, options) {
        super()
        properties = properties || {};

Severity: Minor
Found in src/document.js - About 2 hrs to fix

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

        static createClass (model) {
            class DocumentModel extends Document {
                constructor(properties) {
                    super(model, properties);
                }
    Severity: Minor
    Found in src/document.js - About 1 hr to fix

      Function save has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          save(callback) {
              var hooks = this._model.schema.hooks;
              var self = this;
              return new Promise(function(resolve, reject){
                  hooks.execPre('validate', self, error => {
      Severity: Minor
      Found in src/document.js - About 1 hr to fix

        Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
        Open

        import { EventEmitter } from 'events';
        Severity: Minor
        Found in src/document.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        There are no issues that match your filters.

        Category
        Status