Showing 42 of 266 total issues
File server.test.ts
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-await-in-loop */
/* eslint-disable functional/no-loop-statement */
/* eslint-disable no-restricted-syntax */
import { connect, NatsConnection, JSONCodec, StringCodec } from 'nats'
import { MongoMemoryServer } from 'mongodb-memory-server-core'
Function NewProjectContainer
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function NewProjectContainer(): ReactElement {
const classes = useStyles()
const [activeStep, setActiveStep] = React.useState(0)
const handleNext = (): void => {
Function Register
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Register(): ReactElement {
const classes = useStyles()
// const [register, { loading, data }] = useRegister()
const [register, request] = useRegisterUser()
const [username, setUsername] = useState('')
Function server
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export default async function server(): Promise<void> {
const nc = await connect(process.env.BROKER ?
{ servers: process.env.BROKER } : {})
nc.subscribe(host, { callback: async (error, msg) => {
- 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 Editor
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export default function Editor({ content, lang }: EditorProps): ReactElement {
// const [localContent, setLocalContet] = useState(content || '')
const [reRender, setReRender] = useState(false)
const localContent = useRef(tokenizer(content))
- 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 en
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function en(): void {
locale.set(lang, 'algorithmWord', 'algorithm')
locale.set(lang, 'begin', 'begin')
locale.set(lang, 'end', 'end')
locale.set(lang, 'forWord', 'for')
Function es
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function es(): void {
locale.set(lang, 'algorithmWord', 'algoritmo')
locale.set(lang, 'begin', 'inicio')
locale.set(lang, 'end', 'fin')
locale.set(lang, 'forWord', 'para')
Function Login
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Login(): ReactElement {
if (localStorage.getItem('T__T__T')) Router.push('/')
const classes = useStyles()
// const [register, { loading, data }] = useRegister()
const [login, request] = useLoginUser()
Function Console
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Console(): ReactElement {
const { theme } = useContext(ThemeContext)
const [runtimeObj, setRuntimeObj] = useState(null)
const [variables, dispatch] = useReducer(varsReducer, {})
const { tabs } = useTabs()
File gateway.test.ts
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-empty-function */
import request from 'supertest'
import { app } from './gateway'
const db = {}
Function NestedList
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function NestedList(): ReactElement {
const classes = useStyles()
const [openSrc, setOpenSrc] = React.useState(true)
const [openTest, setOpenTest] = React.useState(true)
Function Register
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function Register(): ReactElement {
const classes = useStyles()
// const [register, { loading, data }] = useRegister()
const [register, request] = useRegisterUser()
const [username, setUsername] = useState('')
- 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 Tabs
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Tabs(): ReactElement {
const classes = useStyles()
const { tabs, addTab, changeTab, saveTab, removeTab } = useTabs()
// const { theme } = setContent(ThemeContext)
const [value, setValue] = React.useState(0)
Function server
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function server(): Promise<void> {
const nc = await connect(process.env.BROKER ?
{ servers: process.env.BROKER } : {})
nc.subscribe(host, { callback: async (error, msg) => {
Function cloneCodemirror
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function cloneCodemirror() {
console.log('installing codemirror')
// "type": "commonjs"
if (!fs.existsSync(libsDir)) fs.mkdirSync(libsDir)
Function callback
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
nc.subscribe(host, { callback: async (error, msg) => {
const { decode, encode } = JSONCodec()
const { reply, data } = msg
if (reply) {
Function LoadingScreen
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LoadingScreen(): ReactElement {
const classes = useStyles()
return (
<>
<div className={classes.project}>
Function Login
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function Login(): ReactElement {
if (localStorage.getItem('T__T__T')) Router.push('/')
const classes = useStyles()
// const [register, { loading, data }] = useRegister()
const [login, request] = useLoginUser()
- 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 server
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default async function server(): Promise<void> {
const nc = await connect(process.env.BROKER ?
{ servers: process.env.BROKER } : {})
nc.subscribe(host, { callback: async (error, msg) => {
- 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 Landing
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Landing(): ReactElement {
// router.prefetch('/dashboard')
return (
<>
<Head title="Algorithm" />