Showing 81 of 198 total issues
Function mappings
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const mappings = (state = initialState, action) => {
const {
data,
type,
indexes,
Function componentDidMount
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentDidMount() {
// sync state from url
let appname = '';
let url = '';
const { mode, isConnected, isHidden, forceReconnect } = this.props;
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
selectAll,
mode,
selectedRows,
Consider simplifying this complex logical expression. Open
Open
if (!isEmptyObject(data)) {
const indexes = Object.keys(data);
let properties = {};
let nestedProperties = {};
const types = [];
Function render
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
columns: allColumns,
nestedColumns: allNestedColumns,
visibleColumns,
Function render
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
mode,
data,
height,
Function bulkUpdate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const bulkUpdate = async (
rawUrl,
indexName,
typeName,
queryData,
File ResultSet.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
import React from 'react';
import { ReactiveList } from '@appbaseio/reactivesearch';
import { connect } from 'react-redux';
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { field } = this.props;
const { hasMounted } = this.state;
let componentId = field;
if (field === '_type') {
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { isShowingModal, dataError, jsonValue } = this.state;
const { _id: documentId, _index: index, _type: type } = this.props.data;
return (
Function getTermsAggregationColumns
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getTermsAggregationColumns = properties => {
const columns = [];
if (properties) {
Object.keys(properties).forEach(item => {
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
value,
mode,
selectedRows,
Function componentDidUpdate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentDidUpdate(prevProps) {
const {
isShowingNestedColumns,
mappings,
nestedColumns,
Function Cell
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const Cell = ({ mapping, column, row, ...props }: Props) => {
if (mapping && (mapping.type || mapping.properties)) {
switch (mapping.type) {
case 'boolean':
return <BooleanCell {...props} key={`${column}-${row}`} />;
- 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 testConnection
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const testConnection = async (appname, rawUrl, reqHeaders = []) => {
const defaultError = 'Unable to connect';
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 render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.state;
const { mode } = this.props;
return (
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { children, mode } = this.props;
const { showModal, error, value } = this.state;
return (
<Fragment>
Function testConnection
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const testConnection = async (appname, rawUrl, reqHeaders = []) => {
const defaultError = 'Unable to connect';
try {
const { url } = parseUrl(rawUrl);
const headers = getHeaders(rawUrl);
Consider simplifying this complex logical expression. Open
Open
if (mappings) {
return (
<StyledCell
css={{ background: colors.tableHead, fontWeight: 'bold' }}
>
Function searchAfter
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const searchAfter = async (
app,
types,
url,
version,