Showing 334 of 1,376 total issues
Function defaultQuery
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
MultiList.defaultQuery = (value, props) => {
let query = null;
const type = props.queryFormat === 'or' ? 'terms' : 'term';
if (!Array.isArray(value) || value.length === 0) {
- 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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { selectedValues } = this.props;
let hasValues = false;
return (
File base.js
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { css } from 'emotion';
import queries from './mediaQueries';
const primaryColor = '#6772e5';
Function defaultQuery
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
MultiList.defaultQuery = (value, props) => {
let query = null;
const type = props.queryFormat === 'or' ? 'terms' : 'term';
if (!Array.isArray(value) || value.length === 0) {
Function setValue
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
setValue(value, isDefaultValue = false, props = this.$props) {
// ignore state updates when component is locked
if (props.beforeValueChange && this.locked) {
return;
}
Function hits
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
hits(newVal, oldVal) {
if (this.$props.pagination) {
// called when page is changed
if (this.isLoading && (oldVal || newVal)) {
if (this.hasPageChangeListener) {
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { size } = this.$props;
const { hits } = this.$data;
const results = parseHits(hits) || [];
const streamResults = parseHits(this.$data.streamHits) || [];
- 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 setValue
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
setValue(value, isDefaultValue = false, props = this.$props, cause) {
// ignore state updates when component is locked
if (props.beforeValueChange && this.locked) {
return;
}
- 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 setValue
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
setValue(value, isDefaultValue = false, props = this.$props) {
// ignore state updates when component is locked
if (props.beforeValueChange && this.locked) {
return;
}
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ReactiveBase
app="streaming-demo"
credentials="40TQvTOh4:302fc9bd-31b8-4794-b58d-e9adecc9b05b"
Function componentWillReceiveProps
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
if (
!isEqual(this.props.sortOptions, nextProps.sortOptions)
|| this.props.sortBy !== nextProps.sortBy
|| this.props.size !== nextProps.size
- 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 setValue
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
setValue(value, isDefaultValue = false, props = this.$props) {
// ignore state updates when component is locked
if (props.beforeValueChange && this.locked) {
return;
}
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { onData, size } = this.props;
const { currentPage } = this.state;
const results = parseHits(this.props.hits) || [];
const streamResults = parseHits(this.props.streamHits) || [];
- 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 componentDidMount
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount() {
this.props.addComponent(this.internalComponent);
this.props.addComponent(this.props.componentId);
if (this.props.stream) {
GeoDistanceDropdown
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class GeoDistanceDropdown extends Component {
constructor(props) {
super(props);
this.state = {
DynamicRangeSlider
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class DynamicRangeSlider extends Component {
constructor(props) {
super(props);
this.state = {
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ReactiveBase
app="meetup_app"
credentials="lW70IgSjr:87c5ae16-73fb-4559-a29e-0a02760d2181"
Function componentWillReceiveProps
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
if (!isEqual(this.props.range, nextProps.range) && nextProps.range) {
this.updateQueryOptions(nextProps, nextProps.range);
// floor and ceil to take edge cases into account
this.updateRange({
File index.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Appbase from 'appbase-js';
import valueReducer from '@appbaseio/reactivecore/lib/reducers/valueReducer';
import queryReducer from '@appbaseio/reactivecore/lib/reducers/queryReducer';
import queryOptionsReducer from '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
Function setStore
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
setStore(props) {
const credentials
= props.url && props.url.trim() !== '' && !props.credentials
? null
: props.credentials;