-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fe examples #323
Feature/fe examples #323
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
8962760 | Triggered | Username Password | 9c3ec1d | src/Examples/appsettings.Development.json | View secret |
8962761 | Triggered | Generic Password | 9c3ec1d | src/Examples/appsettings.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: -0.08 (10.00 -> 9.92)
- Declining Code Health: 3 findings(s) 🚩
@@ -0,0 +1,252 @@ | |||
import { graphql } from '@/gql'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ New issue: Complex Method
Home has a cyclomatic complexity of 10, threshold = 10
export function isFragmentReady<TQuery, TFrag>( | ||
queryNode: DocumentTypeDecoration<TQuery, any>, | ||
fragmentNode: TypedDocumentNode<TFrag>, | ||
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined | ||
): data is FragmentType<typeof fragmentNode> { | ||
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__ | ||
?.deferredFields; | ||
|
||
if (!deferredFields) return true; | ||
|
||
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined; | ||
const fragName = fragDef?.name?.value; | ||
|
||
const fields = (fragName && deferredFields[fragName]) || []; | ||
return fields.length > 0 && fields.every(field => data && field in data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ New issue: Complex Method
isFragmentReady has a cyclomatic complexity of 9, threshold = 9
const createToken = async (scope: UHeadlessScopes[]) => { | ||
const tokenKey = scope.join(','); | ||
if (tokenMap.has(tokenKey)) { | ||
const token = tokenMap.get(tokenKey); | ||
|
||
if (!token){ | ||
throw new Error('Failed to create token. API responed with no data'); | ||
} | ||
|
||
if (!isTokenExpired(token)) { | ||
return token; | ||
} | ||
} | ||
|
||
const { data, error } = await tokenClient.mutation(createTokenQuery, { scope }); | ||
|
||
if (error) { | ||
console.error(error); | ||
throw new Error('Failed to create token. API responed with:', error); | ||
} | ||
|
||
if (!data) { | ||
throw new Error('Failed to create token. API responed with no data'); | ||
} | ||
|
||
tokenMap.set(tokenKey, data); | ||
|
||
return data; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ New issue: Complex Method
createToken has a cyclomatic complexity of 9, threshold = 9
Quality Gate failedFailed conditions |
No description provided.