trezy/firebase-system-update

View on GitHub

Showing 67 of 67 total issues

Function FieldInput has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function FieldInput(props) {
    const {
        alignment,
        autocomplete,
        className,
Severity: Minor
Found in src/components/Form/FieldInput.js - About 2 hrs 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 FieldFile has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function FieldFile(props) {
    const {
        accept,
        className,
        filename,
Severity: Major
Found in src/components/Form/FieldFile.js - About 2 hrs to fix

    Function ProjectConfigurationFooter has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ProjectConfigurationFooter(props) {
        const { projectID } = props
        const {
            data: { projects },
            goBack,
    Severity: Major
    Found in src/components/Installer/ProjectConfigurationFooter.js - About 2 hrs to fix

      Function FieldRadioGroup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      function FieldRadioGroup(props) {
          const {
              className,
              id,
              isDisabled,
      Severity: Minor
      Found in src/components/Form/FieldRadioGroup.js - About 2 hrs 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 Installer has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function Installer() {
          const {
              cancelConfiguration,
              data: { projects },
              finishConfiguration,
      Severity: Major
      Found in src/components/Installer/index.js - About 2 hrs to fix

        Function ProjectSummary has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ProjectSummary(props) {
            const {
                projectID,
                onOpen,
            } = props
        Severity: Major
        Found in src/components/Installer/ProjectSummary.js - About 2 hrs to fix

          Function SetupRealtimeDatabaseFields has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function SetupRealtimeDatabaseFields(props) {
              const { projectID } = props
              const { changeStepCompletion } = useAppContext()
              const {
                  updateValue,
          Severity: Major
          Found in src/components/Installer/SetupRealtimeDatabaseFields.js - About 2 hrs to fix

            Function SetupStorageFields has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function SetupStorageFields(props) {
                const { projectID } = props
                const { changeStepCompletion } = useAppContext()
                const {
                    updateValue,
            Severity: Major
            Found in src/components/Installer/SetupStorageFields.js - About 2 hrs to fix

              Function FieldCheckbox has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function FieldCheckbox(props) {
                  const {
                      className,
                      id,
                      isDisabled,
              Severity: Major
              Found in src/components/Form/FieldCheckbox.js - About 2 hrs to fix

                Function SetupRemoteConfigFields has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function SetupRemoteConfigFields(props) {
                    const { projectID } = props
                    const { changeStepCompletion } = useAppContext()
                    const {
                        updateValue,
                Severity: Major
                Found in src/components/Installer/SetupRemoteConfigFields.js - About 2 hrs to fix

                  Function ConfigureProjects has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function ConfigureProjects() {
                      const {
                          data: { projects },
                          states: {
                              // areProjectsLoaded,
                  Severity: Minor
                  Found in src/components/Installer/ConfigureProjects.js - About 2 hrs to fix

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

                        const handleSubmit = useCallback(async formState => {
                            const {
                                isValid,
                                values,
                            } = formState
                    Severity: Minor
                    Found in src/components/Installer/ProjectConfiguration.js - About 1 hr to fix

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

                          const mapOption = useCallback(([optionValue, details]) => {
                              const {
                                  component,
                                  description,
                                  label,
                      Severity: Minor
                      Found in src/components/Form/FieldRadioGroup.js - About 1 hr to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        export function getProject(options) {
                            const {
                                accessToken,
                                projectID,
                                teamID,
                        Severity: Major
                        Found in src/helpers/vercel.js and 1 other location - About 1 hr to fix
                        src/helpers/vercel.js on lines 101..114

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 69.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        export function getConfiguration(options) {
                            const {
                                accessToken,
                                configurationID,
                                teamID,
                        Severity: Major
                        Found in src/helpers/vercel.js and 1 other location - About 1 hr to fix
                        src/helpers/vercel.js on lines 116..129

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 69.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                case 'saved project':
                                    newState.states.isSaving = false
                                    newState.data.projects[payload.projectID] = {
                                        ...newState.data.projects[payload.projectID],
                                        isSaving: false,
                        Severity: Major
                        Found in src/contexts/AppContext.js and 1 other location - About 1 hr to fix
                        src/contexts/AppContext.js on lines 164..170

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 68.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                case 'save project':
                                    newState.states.isSaving = true
                                    newState.data.projects[payload.projectID] = {
                                        ...newState.data.projects[payload.projectID],
                                        isSaving: true,
                        Severity: Major
                        Found in src/contexts/AppContext.js and 1 other location - About 1 hr to fix
                        src/contexts/AppContext.js on lines 172..178

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 68.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Function handleDeploymentReady has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function handleDeploymentReady(payload) {
                            if (payload.target === 'production') {
                                const {
                                    deployment: {
                                        meta: {
                        Severity: Minor
                        Found in src/pages/api/event.js - About 1 hr to fix

                          Function reducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function reducer(state, action) {
                              const {
                                  payload,
                                  type,
                              } = action
                          Severity: Minor
                          Found in src/components/Form/index.js - About 1 hr to fix

                            Function mapDirectoryListing has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                const mapDirectoryListing = useCallback(item => {
                                    if (item.type === 'dir') {
                                        return (
                                            <Button
                                                className="panel-block"
                            Severity: Minor
                            Found in src/components/GithubExplorer.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language