Showing 13 of 22 total issues
Function exports
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (socket, options = {}) => {
const { sink, source } = toIterable.duplex(socket)
// If the remote address was passed, use it - it may have the peer ID encapsulated
const remoteAddr =
Function incommingDial
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const incommingDial = (offer) => {
if (offer.answer || offer.err) {
return
}
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = ({ handler, upgrader }, WebRTCStar, options = {}) => {
const sioOptions = {
path: '/socket.io/',
transports: ['websocket'],
'force new connection': true,
- 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 HomepageHeader
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (config) => {
nrwlConfig(config);
return {
...config,
Function App
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const App: React.FC = () => {
const namespace: string = localStorage['namespace'] || 'explorer'
const [stack, setStack] = useState<Stack | null>()
useEffect(() => {
Function exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (socket, options = {}) => {
const { sink, source } = toIterable.duplex(socket)
// If the remote address was passed, use it - it may have the peer ID encapsulated
const remoteAddr =
- 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 cleanUrlSIO
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function cleanUrlSIO(ma) {
const maStrSplit = ma.toString().split('/')
const tcpProto = ma.protos()[1].name
const wsProto = ma.protos()[2].name
const tcpPort = ma.stringTuples()[1][1]
- 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 getStack
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getStack = async (namespace: string) => {
let stack = cache.get(namespace)
if (!stack) {
try {
Function close
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
close() {
if (socket.destroyed) return
return new Promise((resolve, reject) => {
const start = Date.now()
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options = {}) {
if (!options.upgrader) {
throw new Error(
'An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.'
)
Function getListenAddress
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getListenAddress = (
protocol: 'http' | 'https',
hostname: string,
port: number | string
) => {
- 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 setPlayground
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const setPlayground = (fastify: FastifyInstance) => {
fastify.get('/', (req, res) => {
let [host, port] = req.headers['host']
? req.headers['host'].split(':')
: [process.env['HOST'] || '0.0.0.0', process.env['PORT'] || '13579']
- 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"