Showing 24 of 152 total issues
File ContractABIs.ts
has 1213 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const nftABI = [
{
inputs: [],
stateMutability: 'nonpayable',
type: 'constructor',
File contractABIs.ts
has 569 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const nftABI = [
{
inputs: [],
stateMutability: 'nonpayable',
type: 'constructor'
File 2faSpec.ts
has 381 lines of code (exceeds 300 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
File configValidationSpec.ts
has 377 lines of code (exceeds 300 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
File dataExportApiSpec.ts
has 355 lines of code (exceeds 300 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
Function setupNodeEvents
has 77 lines of code (exceeds 30 allowed). Consider refactoring. Open
setupNodeEvents (on: any) {
on('before:browser:launch', (browser: any = {}, launchOptions: any) => { // TODO Remove after upgrade to Cypress >=12.5.0 <or> Chrome 119 become available on GitHub Workflows, see https://github.com/cypress-io/cypress-documentation/issues/5479
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args = launchOptions.args.map((arg: any) => {
if (arg === '--headless') {
Function checkDiffs
has 66 lines of code (exceeds 30 allowed). Consider refactoring. Open
const checkDiffs = async (keys: string[]) => {
const data: CacheData = keys.reduce((prev, curr) => {
return {
...prev,
[curr]: {
Function invokeFunction
has 65 lines of code (exceeds 30 allowed). Consider refactoring. Open
async invokeFunction (func) {
if (!this.session) {
this.snackBarHelperService.open('PLEASE_CONNECT_WEB3_WALLET', 'errorBar')
return
}
File app.module.ts
has 315 lines of code (exceeds 300 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
File quantityApiSpec.ts
has 313 lines of code (exceeds 300 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
Function handleAuth
has 56 lines of code (exceeds 30 allowed). Consider refactoring. Open
async handleAuth () {
try {
const { isConnected } = getAccount()
if (isConnected) {
Function invokeFunction
has a Cognitive Complexity of 17 (exceeds 7 allowed). Consider refactoring. Open
async invokeFunction (func) {
if (!this.session) {
this.snackBarHelperService.open('PLEASE_CONNECT_WEB3_WALLET', 'errorBar')
return
}
- 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 deploySelectedContract
has 48 lines of code (exceeds 30 allowed). Consider refactoring. Open
async deploySelectedContract () {
if (!this.session) {
this.snackBarHelperService.open('PLEASE_CONNECT_WEB3_WALLET', 'errorBar')
return
}
Function handleAuth
has 46 lines of code (exceeds 30 allowed). Consider refactoring. Open
async handleAuth () {
try {
const { isConnected } = getAccount()
if (isConnected) {
Function setupNodeEvents
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
setupNodeEvents (on: any) {
on('before:browser:launch', (browser: any = {}, launchOptions: any) => { // TODO Remove after upgrade to Cypress >=12.5.0 <or> Chrome 119 become available on GitHub Workflows, see https://github.com/cypress-io/cypress-documentation/issues/5479
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args = launchOptions.args.map((arg: any) => {
if (arg === '--headless') {
- 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 findFilesWithCodeChallenges
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
export const findFilesWithCodeChallenges = async (paths: readonly string[]): Promise<FileMatch[]> => {
const matches = []
for (const currPath of paths) {
if ((await fs.lstat(currPath)).isDirectory()) {
const files = await fs.readdir(currPath)
- 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 checkData
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
function checkData (data: CacheData, fileData: CacheData) {
const filesWithDiff = []
for (const key in data) {
const fileDataValueAdded = fileData[key].added.sort((a, b) => a - b)
const dataValueAdded = data[key].added.sort((a, b) => a - b)
- 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 seePatch
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
async function seePatch (file: string) {
const fileData = fs.readFileSync(fixesPath + '/' + file).toString()
const snippet = await retrieveCodeSnippet(file.split('_')[0])
if (snippet == null) return
const patch = Diff.structuredPatch(file, file, filterString(snippet.snippet), filterString(fileData))
- 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
Avoid too many return
statements within this function. Open
return { enabled: false, disabledBecause: 'Gitpod' }
Avoid too many return
statements within this function. Open
return { enabled: false, disabledBecause: 'Windows' }