Showing 191 of 352 total issues
Function modifyAppBuildGradle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function modifyAppBuildGradle (projectRoot: string, logger: Logger): Promise<void> {
logger.debug('Looking for android/app/build.gradle')
const appBuildGradlePath = path.join(projectRoot, 'android', 'app', 'build.gradle')
logger.debug('Applying com.bugsnag.android.gradle plugin')
Function modifyRootBuildGradle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function modifyRootBuildGradle (projectRoot: string, pluginVersion: string, logger: Logger): Promise<void> {
logger.debug('Looking for android/build.gradle')
const topLevelBuildGradlePath = path.join(projectRoot, 'android', 'build.gradle')
logger.debug('Adding \'bugsnag-android-gradle-plugin\' to the build script classpath')
try {
Function runMaybeAsyncCallback
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const runMaybeAsyncCallback = (fn, cb) => {
if (typeof fn !== 'function') return cb(null)
try {
// if function appears sync…
if (fn.length !== 2) {
Function load
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
load (client) {
if (!client._isBreadcrumbTypeEnabled(BREADCRUMB_STATE)) {
return
}
Function install
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function install (projectRoot: string, logger: Logger): Promise<void> {
if (platform() !== 'darwin') {
logger.warn('Detected platform is not macOS, skipping')
return
}
Method toWritableArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static WritableArray toWritableArray(Collection<? extends Object> collection) {
WritableArray writableArray = Arguments.createArray();
if (collection == null) {
return writableArray;
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (BugsnagIpcRenderer = window.__bugsnag_ipc__) => ({
load: (client) => {
client.addOnBreadcrumb(breadcrumb => {
try {
BugsnagIpcRenderer.leaveBreadcrumb(Object.assign({}, breadcrumb))
- 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 10 (exceeds 5 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)
- 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
Method toWritableMap
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
static WritableMap toWritableMap(Map<String, ? extends Object> javaMap) {
WritableMap writableMap = Arguments.createMap();
if (javaMap == null) {
- 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 formatComponentName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const formatComponentName = (vm, includeFile) => {
if (vm.$root === vm) return '<Root>'
const options = typeof vm === 'function' && vm.cid != null
? vm.options
: vm._isVue
- 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 mergeOptions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports.mergeOptions = (additionalSchemaKeys, mainOpts, rendererOpts) => {
return Object.keys(module.exports.schema).concat(additionalSchemaKeys).reduce((accum, k) => {
if (Object.prototype.hasOwnProperty.call(rendererOpts, k)) {
if (ALLOWED_IN_RENDERER.includes(k)) {
if (k === 'metadata') {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (NativeClient) => ({
load: (client) => {
client.addOnBreadcrumb(breadcrumb => {
// we copy the breadcrumb's properties over to a new object to ensure its
// to JSON() method doesn't get called before passing the object over 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 exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = ctx => {
if (!ctx) return {}
const request = ctx.req
const connection = request.connection
const address = connection && connection.address && connection.address()
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
const device = {
locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language,
userAgent: nav.userAgent
}
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (win = window) => {
const plugin = {
load: (client) => {
if (!('addEventListener' in win)) return
if (!client._isBreadcrumbTypeEnabled('navigation')) return
Function listener
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const listener = evt => {
let error = evt.reason
let isBluebird = false
// accessing properties on evt.detail can throw errors (see #394)
Function load
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: (client) => {
const sessionTracker = new SessionTracker(client._config.sessionSummaryInterval)
sessionTracker.on('summary', sendSessionSummary(client))
sessionTracker.start()
client._sessionDelegate = {
Function sendMinidump
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sendMinidump = async (minidumpPath, event) => {
const apiKey = (event && event.apiKey) || client._config.apiKey
const url = new URL(client._config.endpoints.minidumps)
url.pathname = `${url.pathname.replace(/\/$/, '')}/minidump`
url.searchParams.set('api_key', apiKey)
Function run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function run (projectRoot: string, urls: OnPremiseUrls): Promise<boolean> {
try {
const { apiKey } = await prompts({
type: 'text',
name: 'apiKey',
Function _createClient
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const _createClient = (opts, jsOpts) => {
if (jsOpts && typeof jsOpts === 'object') {
// mutate the options with anything supplied in JS. This will throw
Object.keys(jsOpts).forEach(k => { opts[k] = jsOpts[k] })
}