Showing 191 of 352 total issues
BugsnagReactNativeImpl
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class BugsnagReactNativeImpl {
static final String MODULE_NAME = "BugsnagReactNative";
private static final String UPDATE_CONTEXT = "ContextUpdate";
Function exports
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (doc = document, win = window) => ({
load: (client) => {
if (!client._config.trackInlineScripts) return
const originalLocation = win.location.href
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (BugsnagIpcRenderer = window.__bugsnag_ipc__) => ({
load: client => {
client.addOnError(async (event) => {
const {
app,
- 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
File client.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
const config = require('./config')
const Event = require('./event')
const Breadcrumb = require('./breadcrumb')
const Session = require('./session')
const map = require('./lib/es-utils/map')
Function configure
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export async function configure (projectRoot: string, options: Options, logger: Logger): Promise<void> {
const iosDir = path.join(projectRoot, 'ios')
let xcodeprojDir
- 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 wrapHandler
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrapHandler (client, flushTimeoutMs, lambdaTimeoutNotifyMs, handler) {
let _handler = handler
if (handler.length > 2) {
// This is a handler expecting a 'callback' argument, so we convert
Function run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export default async function run (argv: string[]): Promise<void> {
try {
const opts = commandLineArgs(topLevelDefs, { argv, stopAtFirstUnknown: true })
if (opts.version) {
- 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 normaliseError
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const normaliseError = (maybeError, tolerateNonErrors, component, logger) => {
let error
let internalFrames = 0
const createAndLogInputError = (reason) => {
Function run
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function run (argv: string[]): Promise<void> {
try {
const opts = commandLineArgs(topLevelDefs, { argv, stopAtFirstUnknown: true })
if (opts.version) {
Function exports
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (win = window) => {
const plugin = {
load: (client) => {
if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return
const listener = evt => {
BugsnagReactNative
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class BugsnagReactNative extends ReactContextBaseJavaModule {
private final BugsnagReactNativeImpl impl;
public BugsnagReactNative(ReactApplicationContext reactContext) {
NativeBugsnagImpl
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class NativeBugsnagImpl extends NativeBugsnagSpec {
private final BugsnagReactNativeImpl impl;
public NativeBugsnagImpl(ReactApplicationContext reactContext) {
super(reactContext);
Function exports
has 51 lines of code (exceeds 25 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)
Function load
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
load (client) {
if (!client._isBreadcrumbTypeEnabled(BREADCRUMB_STATE)) {
return
}
Function _notify
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_notify (event, onError, postReportCallback = noop) {
event.app = assign({}, event.app, {
releaseStage: this._config.releaseStage,
version: this._config.appVersion,
type: this._config.appType
Function configure
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function configure (projectRoot: string, options: Options, logger: Logger): Promise<void> {
const iosDir = path.join(projectRoot, 'ios')
let xcodeprojDir
Function run
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function run (projectRoot: string, urls: OnPremiseUrls): Promise<boolean> {
try {
const { bugsnagCliIntegration } = await prompts({
type: 'confirm',
name: 'bugsnagCliIntegration',
Function load
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
load: (client) => {
const emitter = new EventEmitter()
// proxy all state updates from within the main process
// so that we can emit events for the changes
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
load: client => {
const requestHandler = async (ctx, next) => {
// Get a client to be scoped to this request. If sessions are enabled, use the
// resumeSession() call to get a session client, otherwise, clone the existing client.
const requestClient = client._config.autoTrackSessions ? client.resumeSession() : clone(client)
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
load (client) {
// load the actual session delegate from plugin-browser-session
sessionDelegate.load(client)
if (isNativeClientEnabled(client)) {