Showing 224 of 224 total issues
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',
File actions.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as admin from 'firebase-admin'
import { get, chunk, isObject } from 'lodash'
import { batchCopyBetweenFirestoreRefs } from './utils'
import { downloadFromStorage, uploadToStorage } from '../utils/cloudStorage'
import { to, promiseWaterfall } from '../utils/async'
Function sendBucketConfigRequest
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function sendBucketConfigRequest(bucketConfig) {
try {
// Push request to callGoogleApi cloud function
const pushRef = await database.ref('requests/callGoogleApi').push({
api: 'storage',
Function addEnvironment
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function addEnvironment(newProjectData) {
const { databaseName, serviceAccount, ...otherData } = newProjectData
// Show error if service account is not selected (not part of form)
if (!serviceAccount) {
Function useActionRunner
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function useActionRunner({
projectId,
selectActionTemplate,
selectedTemplate,
setValue
- 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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function LoginPage() {
const classes = useStyles()
const auth = useAuth()
const firestore = useFirestore()
const { showError } = useNotifications()
- 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 ProjectsPage
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ProjectsPage() {
const classes = useStyles()
const match = useRouteMatch()
const { showError, showSuccess } = useNotifications()
const [newDialogOpen, changeNewDialogOpen] = useState(false)
Similar blocks of code found in 2 locations. Consider refactoring. Open
cy.waitUntil(() =>
cy.callFirestore('get', 'projects/test-project').then((project) => {
return (
project &&
project.roles &&
- Read upRead up
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 76.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
cy.waitUntil(() =>
cy.callFirestore('get', 'projects/test-project').then((project) => {
return (
project &&
project.permissions &&
- Read upRead up
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 76.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function runStepsFromEvent
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function runStepsFromEvent(
snap: admin.database.DataSnapshot,
context: functions.EventContext
) {
const eventData = snap.val()
Similar blocks of code found in 3 locations. Consider refactoring. Open
<Grid item xs={12} sm={6} md={6}>
<Typography variant="h6">Operations Logs</Typography>
<Typography variant="subtitle1">
Event tracking for all Project based actions.
</Typography>
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
<Grid item xs={12} sm={6} md={6}>
<Typography variant="h6">Multiple Environment Support</Typography>
<Typography variant="subtitle1">
Manage multiple Firebase Instances as one Project.
</Typography>
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
<Grid item xs={12} sm={6} md={6}>
<Typography variant="h6">Project Sharing</Typography>
<Typography variant="subtitle1">
Share Projects with everyone in your team. See who does what.
</Typography>
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function Notifications
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Notifications() {
const classes = useStyles()
const { allIds, byId, dismissNotification } = useNotifications()
// Only render if notifications exist
if (!allIds || !Object.keys(allIds).length) {
Function Layout
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Layout(props) {
const { classes, children, pages, location } = props
const groupedPages = groupBySlugLength(pages)
const topLevel = topLevelChapters(pages)
return (
Similar blocks of code found in 2 locations. Consider refactoring. Open
<MenuItem
onClick={editAndClose}
data-test="edit-environment-button">
<ListItemIcon className={classes.icon}>
<EditIcon />
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<MenuItem
onClick={removeAndClose}
data-test="delete-environment-button">
<ListItemIcon className={classes.icon}>
<DeleteIcon />
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function runBackupsFromEvent
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function runBackupsFromEvent(snap: admin.database.DataSnapshot, context: functions.EventContext) {
const eventData = snap.val()
const {
inputValues,
template: { backups, inputs }
Function googleLogin
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function googleLogin() {
const provider = new firebase.auth.GoogleAuthProvider()
changeLoadingState(true)
const authMethod =
window.isMobile && window.isMobile.any