Code Issues fixes and suppression
Code Issues can be easily fixed with the corresponding code fixes. The code fixes are operations that allow you to automatically fix the issue by changing the source code, so the issue is no longer valid for the block of code in question. The code fixes are refactoring or code providers assigned to the code issues as fixes.
There are several ways to fix an issue:
- Code Fix hint
- Zoom Window
- Manually apply a fix
Code Fix hint
The hint shows not only the list of code issues, but when you hover the mouse over the issue highlighted in the code editor, available code fixes. You can also see this hint when hovering over the left view bar. Clicking the link with the name of the code fix will automatically fix the issue. Hovering over a link will also show you a preview hint of changes being made after the fix is applied.
Zoom Window
This window appears when you hover the mouse over the marks on the right document bar. The window behaves as a container of several Code Fix hints. Clicking the link works similarly to the Code Fix hint.
Manual Fixes
The fix for an issue can be applied the same way as all other refactoring and/or code operations. For example, from the Refactor!/Code! popup menu:
Issues Suppression
If you don’t like some of the issues or don’t want them to appear in a specific source code, you can easily suppress them for different scopes, such as:
- Solution
- Project
- File
You can also completely disable the issue. If you have disabled the issue, you can reenable it on the code issues Catalog options page:
To suppress an issue, click the blue triangle on the code fix hint, after which the Suppression menu appears with several options available:
Once you have suppressed the issue, you are able to restore it on the Editor | Code Analysis | Issue Suppression options page:
Here, you can see the list of previously suppressed code issues and remove them from this list. After they are removed, they appear again in the source code if appropriate. On this options page, you can also change the suppression scope for the specific code issue.
The suppression settings are individual for every solution and are stored near the solution cache.
This post is a part of post series about CodeRush Code Issues technology. To learn more about code issues, please refer to the appropriate topics:
- Code Issues technology overview
- Code Issues types overview
- Code Issues visual presentation
- Code Issues fixes and suppression (current post)
- Code Issues navigation techniques
- Code Issues tool window
- Code Issues configuration and options
- Code Issues overall list
- Creating your own code issue
Fatal error: Uncaught Error: Call to undefined function eregi_replace() in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php:41 Stack trace: #0 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-hook.php(289): render_comment() #1 H:\root\home\megazoid-001\www\skorkincom\wp-includes\plugin.php(212): WP_Hook->apply_filters() #2 H:\root\home\megazoid-001\www\skorkincom\wp-includes\comment-template.php(1028): apply_filters() #3 H:\root\home\megazoid-001\www\skorkincom\wp-content\themes\inove\functions.php(1163): comment_text() #4 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(179): custom_comments() #5 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(144): Walker_Comment->start_el() #6 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(139): Walker->display_element() #7 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(332): Walker_Comment->display_element() #8 H:\root\home\me in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php on line 41