prescottprue/fireadmin

View on GitHub

Showing 224 of 224 total issues

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

export default (theme) => ({
  root: {
    flexGrow: 1
  },
  new: {
src/routes/ActionTemplates/components/ActionTemplatesList/ActionTemplatesList.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

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

export default function NoRecentActions() {
  const classes = useStyles()
  return (
    <Paper className={classes.empty} data-test="no-recent-actions">
      <span>No Recent Actions Found</span>
src/routes/Projects/routes/Project/routes/ProjectEvents/components/ProjectEventsPage/NoProjectEvents.js on lines 9..16

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

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

function NoProjectEvents() {
  const classes = useStyles()
  return (
    <Paper className={classes.empty} data-test="no-project-events">
      <span>No Project Events Found</span>
src/routes/Projects/routes/Project/routes/Actions/components/RecentActions/NoRecentActions.js on lines 8..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

Function serviceAccountFromFirestorePath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function serviceAccountFromFirestorePath(
  docPath: string
): Promise<any> {
  const projectDoc = await admin.firestore().doc(docPath).get()

Severity: Minor
Found in functions/src/utils/serviceAccounts.ts - About 1 hr to fix

    Function copyFromFirestoreToRTDB has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function copyFromFirestoreToRTDB(
      app1: admin.app.App,
      app2: admin.app.App,
      eventData: ActionStep,
      inputValues: any[]
    Severity: Minor
    Found in functions/src/actionRunner/actions.ts - About 1 hr to fix

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

      StepsViewer.propTypes = {
        steps: PropTypes.array.isRequired,
        watch: PropTypes.func.isRequired,
        activeStep: PropTypes.number.isRequired,
        disabled: PropTypes.bool
      src/routes/ActionTemplate/components/DeleteTemplateDialog/DeleteTemplateDialog.js on lines 25..30
      src/routes/Projects/routes/Project/routes/Environments/components/Instance/Instance.js on lines 117..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 60.

      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

      Instance.propTypes = {
        onRemoveClick: PropTypes.func.isRequired,
        onEditClick: PropTypes.func.isRequired,
        instanceId: PropTypes.string.isRequired,
        instance: PropTypes.object
      src/routes/ActionTemplate/components/DeleteTemplateDialog/DeleteTemplateDialog.js on lines 25..30
      src/routes/Projects/routes/Project/routes/Actions/components/StepsViewer/StepsViewer.js on lines 37..42

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

      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

      DeleteTemplateDialog.propTypes = {
        onClose: PropTypes.func.isRequired,
        onDeleteClick: PropTypes.func.isRequired,
        open: PropTypes.bool.isRequired,
        templateName: PropTypes.string
      src/routes/Projects/routes/Project/routes/Actions/components/StepsViewer/StepsViewer.js on lines 37..42
      src/routes/Projects/routes/Project/routes/Environments/components/Instance/Instance.js on lines 117..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 60.

      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

        afterEach(() => {
          adminInitStub.restore()
          functionsTest.cleanup()
          // Restore http request functionality
          fauxJax.restore()
      functions/src/indexUser/indexUser.spec.ts on lines 51..57

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

      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

        afterEach(() => {
          adminInitStub.restore()
          functionsTest.cleanup()
          // Restore http request functionality
          fauxJax.restore()
      Severity: Major
      Found in functions/src/indexUser/indexUser.spec.ts and 1 other location - About 1 hr to fix
      functions/src/indexActionTemplates/indexActionTemplates.spec.ts on lines 50..56

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

      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

          try {
            await templateRef.delete()
            triggerAnalyticsEvent('deleteActionTemplate', {
              templateId
            })
      src/routes/ActionTemplate/components/ActionTemplatePage/ActionTemplatePage.js on lines 37..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 60.

      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

          try {
            const res = await templateRef.update(updatePath, updatesWithMeta)
            triggerAnalyticsEvent('updateActionTemplate', {
              templateId
            })
      src/routes/ActionTemplate/components/ActionTemplatePage/ActionTemplatePage.js on lines 57..70

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

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

      export async function batchCopyBetweenRTDBInstances(
        app1: admin.app.App,
        app2: admin.app.App,
        step: ActionStep,
        inputValues: any[],
      Severity: Minor
      Found in functions/src/actionRunner/actions.ts - About 1 hr to fix

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

        export async function copyBetweenRTDBInstances(
          app1: admin.app.App,
          app2: admin.app.App,
          eventData: ActionStep,
          inputValues: any[]
        Severity: Minor
        Found in functions/src/actionRunner/actions.ts - About 1 hr to fix

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

          function ActionTemplatePage() {
            const classes = useStyles()
            const { templateId } = useParams()
            const { templateRef, updateTemplate, deleteTemplate } = useActionTemplatePage(
              { templateId }

            Function updateEnvironment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async function updateEnvironment(formValues) {
                const { databaseName, ...other } = formValues
                try {
                  const newValues = {
                    ...other,

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

                  const [err] = await to(
                    callGoogleApi(
                      {
                        val: () => ({
                          projectId: 'asdf',
              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 186..197

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

              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: () => ({
                          projectId: 'asdf',
              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 241..252

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

              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

              export function getChildChapters(pages) {
                return filter(pages, (page) => {
                  const slug = get(page, 'node.frontmatter.slug') || ''
                  return slug.split('/').length > 1
                })
              Severity: Major
              Found in docs/src/utils/index.js and 2 other locations - About 1 hr to fix
              docs/src/components/SidebarItem/SidebarItem.js on lines 31..36
              docs/src/components/layout.js on lines 27..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 58.

              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

              function getChildChapters(pages) {
                return filter(pages, (page) => {
                  const slug = get(page, 'node.frontmatter.slug') || ''
                  return slug.split('/').length > 1
                })
              Severity: Major
              Found in docs/src/components/SidebarItem/SidebarItem.js and 2 other locations - About 1 hr to fix
              docs/src/components/layout.js on lines 27..32
              docs/src/utils/index.js on lines 9..14

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

              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