randytarampi/me

View on GitHub

Showing 7 of 514 total issues

Function instantiateGoogleMapCreator has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
Open

export const instantiateGoogleMapCreator = (getGoogleMap, id) => (dispatch, getState) => {
    const state = getState();
    const googleMap = getGoogleMap();
    const googleMapState = selectors.getMap(state, id);
    let payload = {
Severity: Minor
Found in packages/jsx/src/lib/actions/map/google/instantiateMap.js - About 1 hr to fix

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 {
                _query: {
                    type: {eq: this.type}
                },
                _options: {
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return {
                _query: {
                    status: {eq: this.status}
                },
                _options: options,
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return {
                    _query: {
                        status: {eq: this.status},
                        [this.orderBy]: {[this.orderOperator]: castOrderComparator}
                    },
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return this.geohashQueries.map(geohashQuery => {
                    return {
                        _query: {
                            status: {eq: this.status},
                            geohash: {begins_with: geohashQuery}
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return {
                    _query: {
                        status: {eq: this.status},
                        geohash: {begins_with: this.geohash}
                    },
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return {
                    _query: {
                        type: {eq: this.type},
                        [this.orderBy]: {[this.orderOperator]: castOrderComparator}
                    },
Severity: Major
Found in packages/service/src/lib/postSearchParams.js - About 30 mins to fix
Severity
Category
Status
Source
Language