trezy/react-color-mode

View on GitHub

Showing 4 of 20 total issues

File ColorModeContext.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Module imports
import {
    act,
    cleanup,
    fireEvent,
Severity: Minor
Found in __tests__/ColorModeContext.js - About 2 hrs to fix

    Function ColorModeContextProvider has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function ColorModeContextProvider(props) {
        const { children } = props
        const [state, dispatch] = useReducer(reducer, { ...INITIAL_STATE }, initialState => {
            const newState = { ...initialState }
    
    
    Severity: Minor
    Found in lib/ColorModeContext.js - About 1 hr to fix

      Function testUpdateColorModePreferenceWithConfig has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function testUpdateColorModePreferenceWithConfig(testName, config) {
                  test(testName, () => {
                      // Force local color mode
                      setLocalColorModePreference((config.defaultConfig || {}), config.initialColorModePreference)
      
      
      Severity: Minor
      Found in __tests__/ColorModeContext.js - About 1 hr to fix

        Function testUpdateColorModePreferenceWithConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function testUpdateColorModePreferenceWithConfig(testName, config) {
                    test(testName, () => {
                        // Force local color mode
                        setLocalColorModePreference((config.defaultConfig || {}), config.initialColorMode)
        
        
        Severity: Minor
        Found in __tests__/ColorModeContext.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language