Showing 191 of 352 total issues
Function constructor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (configuration, schema = config.schema, internalPlugins = [], notifier) {
// notifier id
this._notifier = notifier
// intialise opts and config
Function visit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const visit = (obj) => {
if (obj === null || obj === undefined) return obj
if (isSafeLiteral(obj)) {
return obj
Function send
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const send = (opts, body, cb) => {
let errorCallback = (error, response) => {
// an error can still happen on both the request and response even after a response is received,
// so we noop on subsequent calls to ensure this is only handled once
errorCallback = noop
Function addBuildEndpoint
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addBuildEndpoint (projectRoot: string, buildEndpoint: string, logger: Logger): Promise<void> {
try {
const appBuildGradlePath = path.join(projectRoot, 'android', 'app', 'build.gradle')
await insertBugsnagConfigBlock(appBuildGradlePath, logger)
Function addUploadEndpoint
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addUploadEndpoint (projectRoot: string, uploadEndpoint: string, logger: Logger): Promise<void> {
try {
const appBuildGradlePath = path.join(projectRoot, 'android', 'app', 'build.gradle')
await insertBugsnagConfigBlock(appBuildGradlePath, logger)
Function _dispatch
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_dispatch (event) {
const originalSeverity = event.severity
const callbacks = this.client._cbs.e.filter(e => !e._internal)
runCallbacks(callbacks, event, this._onCallbackError, (err, shouldSend) => {
Function createNavigationContainer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createNavigationContainer = (NavigationContainer) => React.forwardRef((props, ref) => {
const { onReady, onStateChange, ...forwardProps } = props
const navigationRef = ref || React.useRef(null)
const routeNameRef = React.useRef(undefined)
Function exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (nav = navigator, win = window) => ({
load: (client) => {
const device = {
locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language,
userAgent: nav.userAgent
- 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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Event.create = function (maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip = 0, logger) {
const [error, internalFrames] = normaliseError(maybeError, tolerateNonErrors, component, logger)
let event
try {
const stacktrace = Event.getStacktrace(
- 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 load
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
load: client => {
if (!client._config.sendCode) return
const loadSurroundingCode = (stackframe, cache) => new Promise((resolve, reject) => {
try {
- 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 getNodeSelector
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getNodeSelector (el, win) {
const parts = [el.tagName]
if (el.id) parts.push('#' + el.id)
if (el.className && el.className.length) parts.push(`.${el.className.split(' ').join('.')}`)
// Can't get much more advanced with the current browser
- 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 makeBrowserWindow
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function makeBrowserWindow ({ windows = [], focusedWindow = null } = {}): BrowserWindowStatic {
const FakeBrowserWindow: BrowserWindowStatic = class implements BrowserWindow {
public index: number
public readonly title: 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 exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = req => {
const connection = req.connection
const address = connection && connection.address && connection.address()
const portNumber = address && address.port
const port = (!portNumber || portNumber === 80 || portNumber === 443) ? '' : `:${portNumber}`
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (callbacks, event, onCallbackError, cb) => {
// This function is how we support different kinds of callback:
// - synchronous - return value
// - node-style async with callback - cb(err, value)
// - promise/thenable - resolve(value)
Function load
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
if (!client._config.autoDetectErrors) return
if (!client._config.enabledErrorTypes.unhandledExceptions) return
function onerror (messageOrEvent, url, lineNo, charNo, error) {
// Ignore errors with no info due to CORS settings
Function configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function configure (projectRoot: string, options: Options, logger: Logger): Promise<void> {
const manifestPath = path.join(projectRoot, 'android', 'app', 'src', 'main', 'AndroidManifest.xml')
try {
const manifest = await fs.readFile(manifestPath, 'utf8')
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = req => {
const connection = req.connection
const address = connection && connection.address && connection.address()
const portNumber = address && address.port
const path = req.getPath() || req.url
Function request
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
net.request = (...args) => {
const request = originalRequest.apply(net, args)
// grab the final URL from the internal "_urlLoaderOptions" - there is some
// processing of the raw URL that we don't want to have to replicate here
Function load
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
// Do not attach any listeners if autoDetectErrors is disabled or unhandledRejections are not an enabled error type
if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return () => { }
// Check if Hermes is available and is being used for promises
Function getSuggestedBugsnagGradleVersion
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function getSuggestedBugsnagGradleVersion (projectRoot: string, logger: Logger): Promise<string> {
let fileContents: string
try {
fileContents = await fs.readFile(path.join(projectRoot, 'android', 'build.gradle'), 'utf8')
} catch (e) {