Showing 21 of 55 total issues
File search.js
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
castArray,
concat,
cloneDeep,
each,
Function actionBuilder
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
function actionBuilder(api) {
return {
async get({ commit, state }, idAndRouting) {
try {
const { id, index, routing } = idAndRouting
- Read upRead up
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 actionBuilder
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actionBuilder(api) {
return {
async get({ commit, state }, idAndRouting) {
try {
const { id, index, routing } = idAndRouting
Function actionsBuilder
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
async refresh({ state, commit, getters }, updateIsReady = true) {
commit('isReady', !updateIsReady)
commit('error', null)
Function actionsBuilder
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
async refresh({ state, commit, getters }, updateIsReady = true) {
commit('isReady', !updateIsReady)
commit('error', null)
- Read upRead up
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 actionBuilder
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function actionBuilder(api) {
return {
clearBatchSearchResults({ commit }) {
commit(CLEAR_BATCH_SEARCH_RESULTS)
},
File document.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { compact, concat, findIndex, flattenDeep, get, keys, map, sortBy, sumBy, uniqBy, values } from 'lodash'
import Vue from 'vue'
import EsDocList from '@/api/resources/EsDocList'
Function actionsBuilder
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
submitExtract({ state }) {
if (state.form.path) {
return api.indexPath(state.form.path, state.form)
Function ProjectsMixin
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const ProjectsMixin = (superclass) =>
class extends superclass {
/**
* Call a function when a project is selected
* @param {String} name - Name of the project
- Read upRead up
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 retrieveQueryTerms
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
retrieveQueryTerms(state) {
let terms = []
function getTerm(query, path, start, operator, isFuzzyNumber = false) {
const term = get(query, join([path, 'term'], '.'), '')
const field = get(query, join([path, 'field'], '.'), '')
- Read upRead up
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 actionsBuilder
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
async starDocuments({ commit }, documents = []) {
const starDocs = prepareDocumentIds(documents).map(function ({ index, documentIds }) {
return api.starDocuments(index, documentIds)
Function retrieveQueryTerms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
retrieveQueryTerms(state) {
let terms = []
function getTerm(query, path, start, operator, isFuzzyNumber = false) {
const term = get(query, join([path, 'term'], '.'), '')
const field = get(query, join([path, 'field'], '.'), '')
Function actionsBuilder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
submitExtract({ state }) {
if (state.form.path) {
return api.indexPath(state.form.path, state.form)
- Read upRead up
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 actionBuilder
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actionBuilder(api) {
const getIndexStatus = async ({ state }, index) => {
try {
if (!has(state.allowedFor, index)) {
// Not allowed index will throw an error
Function actionBuilder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function actionBuilder(api) {
return {
clearBatchSearchResults({ commit }) {
commit(CLEAR_BATCH_SEARCH_RESULTS)
},
- Read upRead up
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 addFilter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
addFilter(body) {
if (this.hasValues()) {
const filterType = this.isNamedEntityAggregation(body) ? 'Parent' : 'Child'
const exclude = this.reverse || this.forceExclude
const filterName = exclude ? 'Exclude' : 'Include'
- Read upRead up
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 getTerm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getTerm(query, path, start, operator, isFuzzyNumber = false) {
Function getWidgetClass
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getWidgetClass() {
return (type) => {
// Check if the provided 'type' is a string and exists in the 'widgetTypes' object
if (isString(type) && type in widgetTypes) {
// Return the corresponding widget class from 'widgetTypes'
- Read upRead up
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 actionsBuilder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function actionsBuilder(api) {
return {
async starDocuments({ commit }, documents = []) {
const starDocs = prepareDocumentIds(documents).map(function ({ index, documentIds }) {
return api.starDocuments(index, documentIds)
- Read upRead up
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 humanSize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function humanSize(
size,
showBytes = false,
{ B = '% B', KB = '% KB', MB = '% MB', GB = '% GB', TB = '% TB' } = {}
) {
- Read upRead up
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"