trezy/firebase-system-update

View on GitHub

Showing 44 of 67 total issues

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

                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

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

                      export const handler = async (request, response) => {
                          const errors = []
                      
                          if (!request.query['projectID']) {
                              return response.status(httpStatus.BAD_REQUEST).json({
                      Severity: Minor
                      Found in src/pages/api/project/[projectID].js - About 1 hr to fix

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

                        function vercelFetch(route, options) {
                            const parsedOptions = { ...options }
                            const defaultOptions = {
                                headers: {
                                    Accept: 'application/json',
                        Severity: Minor
                        Found in src/helpers/vercel.js - About 1 hr to fix

                          Function Button has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const Button = forwardRef((props, ref) => {
                              const {
                                  children,
                                  className,
                                  isDisabled,
                          Severity: Minor
                          Found in src/components/Form/Button.js - About 1 hr to fix

                            Function apiFetch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            async function apiFetch(route, options) {
                                const parsedOptions = { ...options }
                                const defaultOptions = {
                                    headers: {
                                        Accept: 'application/json',
                            Severity: Minor
                            Found in src/helpers/api.js - About 1 hr to fix

                              Function GithubExplorer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function GithubExplorer(props) {
                                  const {
                                      onSelect,
                                      projectID,
                                      title,
                              Severity: Minor
                              Found in src/components/GithubExplorer.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

                              Function FieldColor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function FieldColor(props) {
                                  const {
                                      className,
                                      id,
                                      isDisabled,
                              Severity: Minor
                              Found in src/components/Form/FieldColor.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

                              Function ProjectConfigurationForm has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function ProjectConfigurationForm(props) {
                                  const { projectID } = props
                                  const {
                                      data: { projects },
                                  } = useAppContext()
                              Severity: Minor
                              Found in src/components/Installer/ProjectConfigurationForm.js - About 1 hr to fix

                                Function SelectServicesFields has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function SelectServicesFields() {
                                    return (
                                        <>
                                            <h3 className="heading">
                                                {'Select which Firebase services you would like to have automatically deployed'}
                                Severity: Minor
                                Found in src/components/Installer/SelectServicesFields.js - About 1 hr to fix

                                  Function handler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const handler = async (request, response) => {
                                      const errors = []
                                      const responseJSON = {
                                          accessToken: null,
                                          projects: {},
                                  Severity: Minor
                                  Found in src/pages/api/install.js - About 45 mins 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 ProjectConfiguration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function ProjectConfiguration(props) {
                                      const {
                                          projectID,
                                          isOpen,
                                          onClose,
                                  Severity: Minor
                                  Found in src/components/Installer/ProjectConfiguration.js - About 35 mins 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language