taskrabbit/elasticsearch-dump

View on GitHub
lib/transports/__es__/_mapping.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function setMapping has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setMapping (data, limit, offset, callback) {
    if (this.haveSetMapping === true || data.length === 0) {
      callback(null, 0)
    } else {
      const esRequest = {
Severity: Major
Found in lib/transports/__es__/_mapping.js - About 3 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                    if (parentIndex > -1) {
                      sortedMappings.splice(parentIndex, 0, { key, index, data: mappings[key] })
                    } else {
                      const childIndex = sortedMappings.findIndex(set => (set.data._parent) && (set.data._parent.type === key)) // find child
                      if (childIndex > -1) {
    Severity: Major
    Found in lib/transports/__es__/_mapping.js - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status