bugsnag/bugsnag-js

View on GitHub

Showing 191 of 352 total issues

Function load has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  load: client => {
    if (!client._config.sendCode) return

    const loadSurroundingCode = (stackframe, cache) => new Promise((resolve, reject) => {
      try {
Severity: Minor
Found in packages/plugin-node-surrounding-code/surrounding-code.js - About 1 hr to fix

    Function createClient has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createClient: (opts) => {
        // handle very simple use case where user supplies just the api key as a string
        if (typeof opts === 'string') opts = { apiKey: opts }
        if (!opts) opts = {}
    
    
    Severity: Minor
    Found in packages/browser/src/notifier.js - About 1 hr to fix

      Function create has 26 lines of code (exceeds 25 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(
      Severity: Minor
      Found in packages/core/event.js - About 1 hr to fix

        Function exports has 26 lines of code (exceeds 25 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()
        Severity: Minor
        Found in packages/plugin-koa/src/request-info.js - About 1 hr to fix

          Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = () => ({
            load: (client) => {
              client.addOnError(event => {
                if (event.errors && event.errors.length) {
                  event.errors[0].stacktrace.forEach(sf => {
          Severity: Minor
          Found in packages/plugin-react-native-hermes/hermes.js - About 55 mins to fix

          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 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = net => ({
            load (client) {
              if (!client._isBreadcrumbTypeEnabled(BREADCRUMB_REQUEST)) {
                return
              }
          Severity: Minor
          Found in packages/plugin-electron-net-breadcrumbs/net-breadcrumbs.js - About 55 mins to fix

          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 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = (win = window) => {
            const plugin = {
              load: (client) => {
                if (!('addEventListener' in win)) return
                if (!client._isBreadcrumbTypeEnabled('navigation')) return
          Severity: Minor
          Found in packages/plugin-navigation-breadcrumbs/navigation-breadcrumbs.js - About 55 mins to fix

          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 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = (client, NativeClient) => ({
            sendEvent: (payload, cb = () => {}) => {
              const event = payload.events[0]
              let nativeStack
              if (event.originalError) {
          Severity: Minor
          Found in packages/delivery-react-native/delivery.js - About 55 mins to fix

          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 serialiseEvent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function serialiseEvent (event) {
            const json = event.toJSON()
            const serialisedEvent = {}
          
            for (let i = 0; i < supportedProperties.length; ++i) {
          Severity: Minor
          Found in packages/plugin-electron-deliver-minidumps/event-serialisation.js - About 55 mins to fix

          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 9 (exceeds 5 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
          Severity: Minor
          Found in packages/plugin-react-native-unhandled-rejection/rejection-handler.js - About 55 mins to fix

          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 rnInternalOnUnhandled has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          const rnInternalOnUnhandled = (id, rejection) => {
            let message
            let stack
          
            const stringValue = Object.prototype.toString.call(rejection)
          Severity: Minor
          Found in packages/plugin-react-native-unhandled-rejection/rejection-handler.js - About 55 mins to fix

          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 initializeFlipper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            private static void initializeFlipper(
                Context context, ReactInstanceManager reactInstanceManager) {
              if (BuildConfig.DEBUG) {
                try {
                  /*

          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 initializeFlipper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            private static void initializeFlipper(
                Context context, ReactInstanceManager reactInstanceManager) {
              if (BuildConfig.DEBUG) {
                try {
                  /*

          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 9 (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
          Severity: Minor
          Found in packages/plugin-express/src/express.js - About 55 mins to fix

          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 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = (Vue, client) => {
            const prev = Vue.config.errorHandler
          
            const handler = (err, vm, info) => {
              const handledState = { severity: 'error', unhandled: true, severityReason: { type: 'unhandledException' } }
          Severity: Minor
          Found in packages/plugin-vue/src/vue2.js - About 55 mins to fix

          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 initializeFlipper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            private static void initializeFlipper(
                Context context, ReactInstanceManager reactInstanceManager) {
              if (BuildConfig.DEBUG) {
                try {
                  /*

          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 initializeFlipper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            private static void initializeFlipper(
                Context context, ReactInstanceManager reactInstanceManager) {
              if (BuildConfig.DEBUG) {
                try {
                  /*

          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 9 (exceeds 5 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
          Severity: Minor
          Found in packages/plugin-restify/src/request-info.js - About 55 mins to fix

          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 _createClient has a Cognitive Complexity of 9 (exceeds 5 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] })
            }
          Severity: Minor
          Found in packages/react-native/src/notifier.js - About 55 mins to fix

          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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          export default async function run (projectRoot: string, urls: OnPremiseUrls): Promise<boolean> {
            try {
              const { bugsnagCliIntegration } = await prompts({
                type: 'confirm',
                name: 'bugsnagCliIntegration',
          Severity: Minor
          Found in packages/react-native-cli/src/commands/AutomateSymbolicationCommand.ts - About 55 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language