Showing 81 of 198 total issues
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { mode } = this.props;
return (
<Select
Function getNestedArrayField
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getNestedArrayField = (data, mappings) => {
const fieldsToBeDeleted = {};
const parentFields = {};
const indexTypeMap = {};
data.forEach(dataItem => {
Function openApp
has a Cognitive Complexity of 9 (exceeds 5 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);
- 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 putSettings
has a Cognitive Complexity of 9 (exceeds 5 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);
- 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 addMapping
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const addMapping = async (
indexName,
typeName,
rawUrl,
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 TextCell
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const TextCell = ({
children,
onChange,
mode,
shouldAutoFocus,
- 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 fetchMappings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const fetchMappings = async (appname, rawUrl) => {
const defaultError = 'Unable to fetch mappings';
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 closeApp
has a Cognitive Complexity of 9 (exceeds 5 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);
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
url: rawUrl,
isLoading,
mappings,
- 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 flatten
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const flatten = data => {
const result = {};
function recurse(cur, prop = '') {
if (Object(cur) !== cur) {
- 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 getURL
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getURL = () => {
let url = localStorage.getItem('url') || sessionStorage.getItem('url');
const params = new URLSearchParams(window.location.search);
if (!url || url === 'undefined') {
url = params.has('url') ? params.get('url') : '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 Navigation
has a Cognitive Complexity of 8 (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 searchAfter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const searchAfter = async (
app,
types,
url,
version,
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
mappings,
appname,
sortField,
- 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 getURL
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getURL = () => {
let url = localStorage.getItem('url') || sessionStorage.getItem('url');
const params = new URLSearchParams(window.location.search);
if (!url || url === 'undefined') {
url = params.has('url') ? params.get('url') : '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
Consider simplifying this complex logical expression. Open
if (
!addColumnError &&
addColumnField &&
selectedIndex &&
selectedType &&
Function getSearchAfterData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getSearchAfterData = async (
app,
types,
url,
version,
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 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);
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const addData = async (
indexName,
typeName,
docId,
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
Avoid too many return
statements within this function. Open
return <TextCell {...props} key={`${column}-${row}`} />;