Showing 81 of 198 total issues
Function deleteData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const deleteData = async (
rawUrl,
indexName,
typeName,
queryData,
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 addData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addData = async (
indexName,
typeName,
docId,
rawUrl,
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
isShowingNestedColumns,
nestedSearchableColumns,
searchableColumns: searchCols,
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 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 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 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 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 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 getSortableColumns
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSortableColumns = properties => {
const columns = [];
const sortableTypes = getSortableTypes();
if (properties) {
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 app
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const app = (state = initialState, action) => {
const { appname, url, type, headers } = action;
switch (type) {
case APP.CONNECT_REQUEST:
return {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isConnected } = this.props;
const { url, isProcessingUrl } = this.state;
return (
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>