Showing 30 of 100 total issues

Function createProcess has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createProcess(act: TAct): TProcessCreator {
  return function(itemType: string, options?: any): TProcess {
    let _act = act
    let _itemType = itemType
    let _options = options || {}
Severity: Major
Found in packages/@dckit/store/src/processes/index.ts - About 5 hrs to fix

    Function useStyles has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useStyles = makeStyles((theme: Theme) => {
      const contentPadding = 0
      const drawerWidth = 240
      const drawerMinWidth = 56
      const appBarHeight = 48
    Severity: Major
    Found in packages/@dckit/ui/src/AppLayout/styles.ts - About 4 hrs to fix

      File testData.ts has 320 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Acts } from '../types'
      
      export const TestItem = 'testItem'
      
      export const testItems = [
      Severity: Minor
      Found in packages/@dckit/store/src/__tests__/testData.ts - About 3 hrs to fix

        Function AppLayout has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function AppLayout(props: AppLayoutProps) {
          const {
            PageBarContainer = DefaultContainer,
            ContentContainer = DefaultContainer,
            CollapseIcon = MenuOpen,
        Severity: Major
        Found in packages/@dckit/ui/src/AppLayout/index.tsx - About 3 hrs to fix

          Function ToggleField has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function ToggleField(props: MuiFieldProps) {
            const classes = useStyles()
            const {
              container,
              directionColumn,
          Severity: Major
          Found in packages/@dckit/forms/src/fields/ToggleField/index.tsx - About 2 hrs to fix

            Function RadioField has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function RadioField(props: MuiFieldProps) {
              const classes = useStyles()
              const {
                container,
                directionColumn,
            Severity: Major
            Found in packages/@dckit/forms/src/fields/RadioField/index.tsx - About 2 hrs to fix

              Function DemoForm has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const DemoForm = () => {
                const [initialValues, setInitialValues] = useState({} as InitialValues)
              
                useEffect(() => {
                  const timeout = setTimeout(() => {
              Severity: Major
              Found in packages/test-app/src/forms/index.tsx - About 2 hrs to fix

                Function Form has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function Form(props: FormProps) {
                  const {
                    fields,
                    fieldsConfig,
                    renderActions,
                Severity: Major
                Found in packages/@dckit/forms/src/Form/index.tsx - About 2 hrs to fix

                  Function MultiGenericField has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function MultiGenericField(
                    props: MuiFieldProps & GenericMultiFieldProps
                  ) {
                    const classes = useStyles()
                    const { container, noselect } = classes
                  Severity: Major
                  Found in packages/@dckit/forms/src/fields/MultiGenericField/index.tsx - About 2 hrs to fix

                    Function CheckControl has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function CheckControl(props: CheckControlProps) {
                      const classes = useStyles()
                    
                      const {
                        noselect,
                    Severity: Major
                    Found in packages/@dckit/forms/src/fields/CheckField/CheckControl.tsx - About 2 hrs to fix

                      Function SelectField has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function SelectField(props: MuiFieldProps) {
                        const {
                          options = [],
                          controlProps = {},
                          name,
                      Severity: Minor
                      Found in packages/@dckit/forms/src/fields/SelectField/index.tsx - About 1 hr to fix

                        Function MultiControl has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function MultiControl(props: MultiControlProps) {
                          const classes = useStyles()
                          const { noselect, marginRight, marginZero, flexGrow, smallLabel } = classes
                        
                          const {
                        Severity: Minor
                        Found in packages/@dckit/forms/src/fields/MultiGenericField/MultiControl.tsx - About 1 hr to fix

                          Function FormWithDefaults has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function FormWithDefaults(props: FormProps) {
                            const {
                              renderActions,
                              initialValues,
                              fieldsDisabled = false,
                          Severity: Minor
                          Found in packages/@dckit/forms/src/FormWithDefaults/index.tsx - About 1 hr to fix

                            Function Form has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const Form = () => {
                              const [initialValues, setInitialValues] = useState({} as InitialValues)
                            
                              useEffect(() => {
                                const timeout = setTimeout(() => {
                            Severity: Minor
                            Found in packages/@dckit/forms/src/__tests__/Form.tsx - About 1 hr to fix

                              Function useStyles has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const useStyles = makeStyles((theme: Theme) => {
                                const drawerWidth = 240
                                const drawerMinWidth = 56
                              
                                const transition = {
                              Severity: Minor
                              Found in packages/@dckit/ui/src/SideBar/styles.ts - About 1 hr to fix

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

                                export const MultiToggle = React.memo(function MultiToggle(
                                  props: MultiToggleProps
                                ) {
                                  const {
                                    name,
                                Severity: Minor
                                Found in packages/@dckit/forms/src/fields/MultiToggleField/MultiToggle.tsx - About 1 hr to fix

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

                                  export function PasswordField(props: MuiFieldProps) {
                                    const classes = useStyles()
                                    const [showPassword, setShowPassword] = useState(false)
                                  
                                    const handleClickShowPassword = () => setShowPassword(!showPassword)
                                  Severity: Minor
                                  Found in packages/@dckit/forms/src/fields/PasswordField/index.tsx - About 1 hr to fix

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

                                    export function FormField(props: FormFieldProps) {
                                      const {
                                        name,
                                        required,
                                        disabled,
                                    Severity: Minor
                                    Found in packages/@dckit/forms/src/fields/FormField/index.tsx - About 1 hr to fix

                                      Function updateOrAppendItemByKey has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      function updateOrAppendItemByKey(state: TState, action: TAction): TState {
                                        const { itemType, data, id, field, itemState } = getParams(state, action)
                                        if (!id && !field) return state
                                      
                                        const key: string = String(id || field)
                                      Severity: Minor
                                      Found in packages/@dckit/store/src/reducers/index.ts - 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

                                      Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function registerValidSW(swUrl: string, config?: Config) {
                                        navigator.serviceWorker
                                          .register(swUrl)
                                          .then(registration => {
                                            registration.onupdatefound = () => {
                                      Severity: Minor
                                      Found in packages/test-app/src/serviceWorker.ts - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language