prescottprue/fireadmin

View on GitHub

Showing 224 of 224 total issues

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

                  <Grid>
                    <FormControlLabel
                      control={
                        <Checkbox
                          name="writeOnly"
src/routes/Projects/routes/Project/routes/Environments/components/EditEnvironmentDialog/EditEnvironmentDialog.js on lines 146..158

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

                  <Grid>
                    <FormControlLabel
                      control={
                        <Checkbox
                          name="readOnly"
src/routes/Projects/routes/Project/routes/Environments/components/EditEnvironmentDialog/EditEnvironmentDialog.js on lines 159..171

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 handleServiceAccountCreate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function handleServiceAccountCreate(
  snap: functions.firestore.DocumentSnapshot
): Promise<null> {
  const eventData = snap.data()
  if (!eventData?.serviceAccount) {
Severity: Minor
Found in functions/src/copyServiceAccountToFirestore/index.ts - About 1 hr to fix

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

    function AccountMenu() {
      const classes = useStyles()
      const [anchorEl, setMenu] = useState(null)
      const history = useHistory()
      const firebase = useFirebaseApp()
    Severity: Minor
    Found in src/containers/Navbar/AccountMenu.js - About 1 hr to fix

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

      PostsListItem.propTypes = {
        title: PropTypes.string,
        excerpt: PropTypes.string,
        slug: PropTypes.string,
        date: PropTypes.string,
      Severity: Major
      Found in docs/src/components/PostsListItem/PostsListItem.js and 2 other locations - About 1 hr to fix
      docs/src/components/SEO/SEO.js on lines 43..50
      docs/src/html.js on lines 33..40

      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 66.

      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 3 locations. Consider refactoring.
      Open

      SEO.propTypes = {
        isBlogPost: PropTypes.bool,
        path: PropTypes.string,
        description: PropTypes.string,
        title: PropTypes.string,
      Severity: Major
      Found in docs/src/components/SEO/SEO.js and 2 other locations - About 1 hr to fix
      docs/src/components/PostsListItem/PostsListItem.js on lines 32..39
      docs/src/html.js on lines 33..40

      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 66.

      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

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

        const {
          toggleNewDialog,
          toggleDeleteDialog,
          toggleEditDialog,
          selectServiceAccount,
      src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/useEnvironmentsPage.js on lines 215..229

      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 66.

      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 3 locations. Consider refactoring.
      Open

      HTML.propTypes = {
        htmlAttributes: PropTypes.object,
        headComponents: PropTypes.array,
        bodyAttributes: PropTypes.object,
        preBodyComponents: PropTypes.array,
      Severity: Major
      Found in docs/src/html.js and 2 other locations - About 1 hr to fix
      docs/src/components/PostsListItem/PostsListItem.js on lines 32..39
      docs/src/components/SEO/SEO.js on lines 43..50

      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 66.

      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

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

        return {
          toggleNewDialog,
          toggleDeleteDialog,
          toggleEditDialog,
          selectServiceAccount,
      src/routes/Projects/routes/Project/routes/Environments/components/EnvironmentsPage/EnvironmentsPage.js on lines 18..32

      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 66.

      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 AccountEditor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function AccountEditor() {
        const { showError } = useNotifications()
        const classes = useStyles()
        const firestore = useFirestore()
        const user = useUser()
      Severity: Minor
      Found in src/routes/Account/components/AccountEditor/AccountEditor.js - About 1 hr to fix

        Function shallowRtdbGet has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export async function shallowRtdbGet(opts, rtdbPath: string | undefined): Promise<any> {
          const { projectId, environmentId, databaseName } = opts
          if (!environmentId) {
            throw new Error(
              'environmentId is required for action to authenticate through serviceAccount'
        Severity: Minor
        Found in functions/src/actionRunner/utils.ts - About 1 hr to fix

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

          export async function getAppFromServiceAccount(opts, eventData: ActionRunnerEventData): Promise<admin.app.App> {
            const { databaseURL, storageBucket, environmentKey, id } = opts
            if (!databaseURL) {
              throw new Error(
                'databaseURL is required for action to authenticate through serviceAccount'
          Severity: Minor
          Found in functions/src/utils/serviceAccounts.ts - About 1 hr to fix

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

              const filterString = ignoreIds
                .map(
                  (id, index) =>
                    `${
                      index !== 0 && index !== ignoreIds.length ? 'AND ' : ''
            Severity: Major
            Found in src/components/CollectionSearch/CollectionSearch.js and 1 other location - About 1 hr to fix
            src/components/UsersSearch/UsersSearch.js on lines 41..48

            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 63.

            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

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

              const filterString = ignoreIds
                .map(
                  (id, index) =>
                    `${
                      index !== 0 && index !== ignoreIds.length ? 'AND ' : ''
            Severity: Major
            Found in src/components/UsersSearch/UsersSearch.js and 1 other location - About 1 hr to fix
            src/components/CollectionSearch/CollectionSearch.js on lines 36..43

            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 63.

            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 removeCollection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            async function removeCollection(
              collectionSnap: admin.firestore.CollectionReference
            ): Promise<null | any[]> {
              // TODO: Handle deleting documents in batches
              const [getErr, collectionQueryResult] = await to(collectionSnap.get())
            Severity: Minor
            Found in functions/src/cleanupProject/index.ts - About 1 hr to fix

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

                              <Grid
                                item
                                xs={8}
                                md={3}
                                style={{
              src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/ActionsPage.js on lines 119..142

              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 62.

              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

                              <Grid
                                item
                                xs={8}
                                md={3}
                                style={{
              src/routes/Projects/routes/Project/routes/Actions/components/ActionsPage/ActionsPage.js on lines 99..118

              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 62.

              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

                  const [err] = await to(
                    callGoogleApi(
                      {
                        val: () => ({
                          api: 'compute',
              Severity: Major
              Found in functions/src/callGoogleApi/callGoogleApi.spec.ts and 1 other location - About 1 hr to fix
              functions/src/callGoogleApi/callGoogleApi.spec.ts on lines 78..90

              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 62.

              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

                  const [err] = await to(
                    callGoogleApi(
                      {
                        val: () => ({
                          api: 'compute',
              Severity: Major
              Found in functions/src/callGoogleApi/callGoogleApi.spec.ts and 1 other location - About 1 hr to fix
              functions/src/callGoogleApi/callGoogleApi.spec.ts on lines 110..122

              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 62.

              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

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

              export default (theme) => ({
                root: {
                  flexGrow: 1
                },
                new: {
              src/routes/ActionTemplates/components/PrivateActionTemplates/PrivateActionTemplates.styles.js on lines 1..15

              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 61.

              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

              Severity
              Category
              Status
              Source
              Language