Showing 8 of 20 total issues
Function zeroMatrix
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
const zeroMatrix = (matrix) => {
const rows = matrix.length
const columns = matrix[0].length
const rowsToZero = []
- 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 getInitialProps
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async getInitialProps(ctx) {
const {
Component,
router,
ctx: { req, res },
Function withThemeProvider
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const withThemeProvider = (App) => {
const ThemeProvider = (props) => {
/**
* This block of code sets the client-side theme to be equal to the
* server-side theme on the initial client side render.It does so by
Function zeroMatrix
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const zeroMatrix = (matrix) => {
const rows = matrix.length
const columns = matrix[0].length
const rowsToZero = []
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { apolloClient, Component, pageProps } = this.props
return (
<ApolloProvider client={apolloClient}>
Function BottomTabNavigator
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function BottomTabNavigator() {
const colorScheme = useColorScheme()
return (
<BottomTab.Navigator
Function arrayIndexAndElementEquality
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
const arrayIndexAndElementEquality = (array) => {
let start = 0
let end = array.length - 1
while (start <= end) {
- 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
Open
return 'purple'