mountain-pass/addressr

View on GitHub
client/elasticsearch.js

Summary

Maintainability
A
0 mins
Test Coverage
B
81%

Insert ;
Open

const ELASTIC_PASSWORD = process.env.ELASTIC_PASSWORD || undefined
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      index: ES_INDEX_NAME
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

                'trim'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ indexPutSettingsResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  exists = await esClient.indices.exists({ index: ES_INDEX_NAME })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

          }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      body: indexBody
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const ELASTIC_HOST = process.env.ELASTIC_HOST || '127.0.0.1'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const ELASTIC_USERNAME = process.env.ELASTIC_USERNAME || undefined
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

        }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

          }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Definition for rule 'unicorn/no-null' was not found.
Open

const waitPort = require('wait-port')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const error = debug('error')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              replacement: ''
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  logger('index exists:', exists)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const ES_INDEX_NAME = process.env.ES_INDEX_NAME || 'addressr'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ deleteIndexResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              synonyms
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ indexOpenResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              lowercase: false
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const waitPort = require('wait-port')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

import debug from 'debug'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const logger = debug('api')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger(`creating index: ${ES_INDEX_NAME}`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      body: indexBody
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Definition for rule 'unicorn/prevent-abbreviations' was not found.
Open

const waitPort = require('wait-port')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Definition for rule 'unicorn/no-process-exit' was not found.
Open

const waitPort = require('wait-port')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  const exists = await esClient.indices.exists({ index: ES_INDEX_NAME })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              type: 'keyword'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

        confidence: { type: 'integer' }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

    }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

export const ELASTIC_PORT = Number.parseInt(process.env.ELASTIC_PORT || '9200')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    await dropIndex(esClient)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

          }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ indexCreateResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  let exists = await esClient.indices.exists({ index: ES_INDEX_NAME })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  logger('checking if index exists')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  logger('checking if index exists')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  logger('index exists:', exists.body)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

          enabled: false
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      index: ES_INDEX_NAME
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const ELASTIC_PROTOCOL = process.env.ELASTIC_PROTOCOL || 'http'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              ]
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              type: 'keyword'
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      index: ES_INDEX_NAME
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ indexPutMappingResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

const elasticsearch = require('@opensearch-project/opensearch')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Definition for rule 'unicorn/filename-case' was not found.
Open

const waitPort = require('wait-port')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ indexCloseResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      body: indexBody.mappings
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

      index: ES_INDEX_NAME
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Replace `connecting·elastic·search·client·on·${eshost}:${esport}...)with⏎··············connecting·elastic·search·client·on·${eshost}:${esport}...⏎············);`
Open

            logger(`connecting elastic search client on ${eshost}:${esport}...`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  logger(`indexGetResult:\n${JSON.stringify(indexGetResult, undefined, 2)}`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Replace ${ELASTIC_PROTOCOL}://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${eshost}:${esport}`·:` with `?·`${ELASTIC_PROTOCOL}://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${eshost}:${esport}
Open

              `${ELASTIC_PROTOCOL}://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${eshost}:${esport}` :
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            }
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            logger('retrying...')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Replace resolve with (resolve)
Open

      await new Promise(resolve => {
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            )
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger(`trying to reach elastic search on ${eshost}:${esport}...`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

    logger({ refreshResult })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            global.esClient = esClient
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

        timeout
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            await esClient.ping()
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            logger(`...connected to ${eshost}:${esport}`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

              setTimeout(() => resolve(), interval)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

  })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

      })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Replace resolve with (resolve)
Open

            await new Promise(resolve => {
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

      })
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

      )
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

              node
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

        logger(`...${eshost}:${esport} is reachable`)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Delete ·?
Open

            const node = ELASTIC_USERNAME ?
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

      logger('retrying...')
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Replace ${ELASTIC_PROTOCOL}://${eshost}:${esport} with ${ELASTIC_PROTOCOL}://${eshost}:${esport};
Open

              `${ELASTIC_PROTOCOL}://${eshost}:${esport}`
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            const esClient = new elasticsearch.Client(esClientOptions)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

            return esClient
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ,
Open

    includeDefaults: true
Severity: Minor
Found in client/elasticsearch.js by eslint

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

Insert ;
Open

        setTimeout(() => resolve(), interval)
Severity: Minor
Found in client/elasticsearch.js by eslint

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

There are no issues that match your filters.

Category
Status