Showing 191 of 352 total issues
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (app, client) => {
const prev = app.config.errorHandler
const handler = (err, vm, info) => {
const handledState = { severity: 'error', unhandled: true, severityReason: { type: 'unhandledException' } }
- 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 _configure
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_configure (opts, internalPlugins) {
const schema = reduce(internalPlugins, (schema, plugin) => {
if (plugin && plugin.configSchema) return assign({}, schema, plugin.configSchema)
return schema
}, this._schema)
- 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 getSuggestedBugsnagGradleVersion
has a Cognitive Complexity of 13 (exceeds 5 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) {
- 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 _configure
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
_configure (opts, internalPlugins) {
const schema = reduce(internalPlugins, (schema, plugin) => {
if (plugin && plugin.configSchema) return assign({}, schema, plugin.configSchema)
return schema
}, this._schema)
Function buildAndroid
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildAndroid: function buildAndroid (sourceFixturesIn, destFixturesIn) {
try {
const baseDir = process.env.PWD
const sourceFixtures = `${baseDir}/${sourceFixturesIn}`
const destFixtures = `${baseDir}/${destFixturesIn}`
Function load
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
if (!isEnabledFor(client)) {
return
}
Function sendSessionSummary
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sendSessionSummary = client => sessionCounts => {
// exit early if the current releaseStage is not enabled
if (client._config.enabledReleaseStages !== null && !client._config.enabledReleaseStages.includes(client._config.releaseStage)) {
client._logger.warn('Session not sent due to releaseStage/enabledReleaseStages configuration')
return
Function load
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return
const listener = evt => {
let error = evt.reason
let isBluebird = false
Function insertAndroid
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function insertAndroid (projectRoot: string, logger: Logger): Promise<void> {
logger.info('Adding Bugsnag to the Android layer')
let mainApplicationPath
try {
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = api => {
// NB: This function can be called without an api argument, e.g. by bin/bundle
const presets = []
const plugins = []
Function createClient
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createClient = (createProcessClient, process) => {
const Bugsnag = {
_client: null,
lastRunInfo: null,
start: (opts) => {
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (data) {
const seen = []
const visit = (obj) => {
if (obj === null || obj === undefined) return obj
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (NativeClient, process, electronApp, BrowserWindow, filestore, NativeApp = native) => ({
name: 'electronApp',
load (client) {
const app = {}
const lastRunInfo = filestore.getLastRunInfo()
- 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (net, client) => {
const send = (opts, formData) => {
return new Promise((resolve, reject) => {
const req = net.request(opts, response => {
response.on('error', reject)
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
load: client => {
const requestHandler = (req, res, next) => {
const dom = domain.create()
// Get a client to be scoped to this request. If sessions are enabled, use the
- 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 deserialiseEvent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function deserialiseEvent (json, minidumpPath) {
if (!json || typeof json !== 'object') {
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 start
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: (opts) => {
if (Bugsnag._client) {
Bugsnag._client._logger.warn('Bugsnag.start() was called more than once. Ignoring.')
return Bugsnag._client
}
Function writeToPackageJson
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function writeToPackageJson (packageJsonPath: string, uploadUrl?: string, buildUrl?: string): Promise<void> {
try {
const data = await fs.readFile(packageJsonPath, 'utf8')
const packageJson = JSON.parse(data)
Function _redeliver
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _redeliver () {
try {
if (this._sending) {
return
}
Function load
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: client => {
client.addOnError(async (event) => {
const {
app,
breadcrumbs,