Showing 81 of 201 total issues
Function handleFetchMappings
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function* handleFetchMappings() {
const defaultError = 'Unable to get mappings';
const defaultErrorDescription = 'Please add mappings';
try {
yield put(clearError());
- 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 searchAfter
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const searchAfter = async (
app,
types,
url,
version,
Function addData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addData = async (
indexName,
typeName,
docId,
rawUrl,
Function getSampleData
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSampleData = properties => {
const data = {};
Object.keys(properties).forEach(item => {
if (META_FIELDS.indexOf(item) === -1) {
switch (properties[item].type) {
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
isShowingNestedColumns,
nestedSearchableColumns,
searchableColumns: searchCols,
Function addMapping
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addMapping = async (
indexName,
typeName,
rawUrl,
field,
Function getAnalyzersApi
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getAnalyzersApi = async (rawUrl, indexName) => {
const defaultError = 'Unable to get version';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function putSettings
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const putSettings = async (rawUrl, indexName) => {
const defaultError = 'Unable to get version';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function openApp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const openApp = async (rawUrl, indexName) => {
const defaultError = 'Unable to get version';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function closeApp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const closeApp = async (rawUrl, indexName) => {
const defaultError = 'Unable to get version';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function data
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const data = (state = initialState, action) => {
const { type } = action;
const { reactiveListKey } = state;
switch (type) {
case DATA.ADD_DATA_REQUEST:
Function getSortableColumns
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSortableColumns = properties => {
const columns = [];
const sortableTypes = getSortableTypes();
if (properties) {
Function search
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const search = async (app, type, rawUrl, version, fetchData) => {
const defaultError = 'Unable to get count';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function bulkUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const bulkUpdate = async (
rawUrl,
indexName,
typeName,
queryData,
- 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 getCount
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getCount = async (app, type, rawUrl, version) => {
const defaultError = 'Unable to get count';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function fetchMappings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fetchMappings = async (appname, rawUrl) => {
const defaultError = 'Unable to fetch mappings';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Function getAnalyzersApi
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const getAnalyzersApi = async (rawUrl, indexName) => {
const defaultError = 'Unable to get version';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
- 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 Navigation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Navigation = ({ indexes, isConnected, history }: Props) => {
const [selectedKey, setSelectedKey] = useState('browse');
useEffect(() => {
const routeName = window.location.pathname.substring(1);
- 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 render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isShowingDetails } = this.state;
const { description, handleReload } = this.props;
return (
<Fragment>
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { mode } = this.props;
return (
<Select