Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1141

Try-catch blocks should not be nested

    Details

    • Message:
      Extract this nested try block into a separate method or combine it with the outer block.
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      Flex
    • Covered Languages:
      C, C++, Java, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      20min
    • Analysis Scope:
      Main Sources, Test Sources
    • PMD:
      ExceptionAsFlowControl
    • ReSharper:
      TryStatementsCanBeMerged

      Description

      Nesting try/catch blocks severely impacts the readability of source code because it makes it too difficult to understand which block will catch which exception.

        Attachments

          Issue Links

          1.
          C-Family RSPEC-2580 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                freddy.mallet Freddy Mallet (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: