Showing 76 of 224 total issues
File actionRunner.spec.ts
has 784 lines of code (exceeds 250 allowed). Consider refactoring. Open
import 'mocha'
import * as admin from 'firebase-admin'
import fs from 'fs'
import { expect } from 'chai'
import * as sinon from 'sinon'
Function ActionTemplateSteps
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ActionTemplateSteps() {
const classes = useStyles()
const { control, register, watch } = useFormContext()
const name = 'steps'
const { fields, remove, append } = useFieldArray({ control, name })
Function ActionTemplateBackups
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ActionTemplateBackups() {
const classes = useStyles()
const { control, register, watch } = useFormContext()
const name = 'backups'
const { fields, remove, append } = useFieldArray({ control, name })
Function HomePage
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HomePage() {
const classes = useStyles()
return (
<Grid container spacing={8} justify="center" className={classes.root}>
File utils.ts
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as admin from 'firebase-admin'
import fetch from 'node-fetch'
import { omit } from 'lodash'
import { PROJECTS_COLLECTION } from '../constants/firebasePaths'
import {
Function ActionTemplateInputs
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ActionTemplateInputs() {
const classes = useStyles()
const { control, register, watch } = useFormContext()
const name = 'inputs'
const { fields, remove, append } = useFieldArray({ control, name })
Function ActionTemplateEnvs
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ActionTemplateEnvs() {
const classes = useStyles()
const { control, register, watch } = useFormContext()
const name = 'environments'
const { fields, remove, append } = useFieldArray({ control, name })
File runSteps.ts
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { map } from 'lodash'
import {
copyFromRTDBToFirestore,
Function callGoogleApi
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function callGoogleApi(
snap: admin.database.DataSnapshot,
context: functions.EventContext
): Promise<any> {
const eventVal = snap.val()
Function ActionTemplatesList
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ActionTemplatesList() {
const classes = useStyles()
const {
user,
toggleNewDialog,
Function runAction
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function runAction(formValues) {
const { environmentValues } = formValues
const selectedEnvironments = map(
environmentValues,
(envKey) => environmentsById[envKey]
Function BucketConfigForm
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function BucketConfigForm({ projectId }) {
const classes = useStyles()
const methods = useForm({
defaultValues: { body: { cors: [{ origin: ['*'] }] } }
})
- Read upRead up
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 useActionTemplatesList
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useActionTemplatesList() {
const { showSuccess, showError } = useNotifications()
// State
const [newDialogOpen, changeDialogState] = useState(false)
Function runStep
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export async function runStep({
inputs,
convertedInputValues,
convertedEnvs,
step,
- Read upRead up
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
File RolesTableRow.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { startCase } from 'lodash'
import { useForm } from 'react-hook-form'
import Button from '@material-ui/core/Button'
Function runAction
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function runAction(
snap: admin.database.DataSnapshot,
context: functions.EventContext
): Promise<null> {
const eventData = snap.val() || {}
Function useEnvironmentsPage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default function useEnvironmentsPage({ projectId }) {
const { showError, showSuccess } = useNotifications()
// State
const [newDialogOpen, changeNewDialogOpen] = useState(false)
- Read upRead up
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 LoginPage
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LoginPage() {
const classes = useStyles()
const auth = useAuth()
const firestore = useFirestore()
const { showError } = useNotifications()
Function useSetupMessaging
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useSetupMessaging() {
const messaging = useMessaging()
const analytics = useAnalytics()
const firestore = useFirestore()
const { FieldValue } = useFirestore
Function createValidActionRunnerStubs
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createValidActionRunnerStubs(opts?: any) {
const {
projectId = 'asdfasdf1',
srcResource = 'rtdb',
destResource = 'rtdb',