OCLint的部分规则(Empty 部分)

2024-06-21 04:18
文章标签 规则 部分 empty oclint

本文主要是介绍OCLint的部分规则(Empty 部分),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

OCLint的部分规则(Empty 部分)

对OCLint的部分规则进行简单翻译解释,有部分进行了验证以及进一步分析、测试。OCLint其他相关内容如下:

--
OCLint-iOS-OC项目几种简单使用OCLint的部分规则(Basic 部分)
OCLint的部分规则(Unuseed 部分)OCLint的部分规则(Size 部分)
OCLint的部分规则(Redundant 部分)OCLint的部分规则(Naming 部分)
OCLint的部分规则(Migration 部分)OCLint的部分规则(Empty 部分)
OCLint的部分规则(Design 部分)OCLint的部分规则(Convention 部分)
OCLint的部分规则(CoCoa 部分)



1、empty catch statement

      Since:0.6 定义类传送门~点击

This rule detects instances where an exception is caught, but nothing is done about it.

简单解释:捕获了异常,在Catch中什么都没有做的情况。

    void example()  {try {int* m= new int[1000];}catch(...)                  // empty catch statement, this swallows an exception{}}
2、empty do/while statement

      Since:0.6 定义类传送门~点击

This rule detects instances where do-while statement does nothing.

简单解释:空的do-while检查。

    void example() {do{                           // empty do-while statement} while(1);}
3、empty else block

      Since:0.6 定义类传送门~点击

This rule detects instances where a else statement does nothing.

简单解释:空的else检查。

    int example(int a)  {if (1)  {return a + 1;}  else  {               // empty else statement, can be safely removed}}
4、empty finally statement

      Since:0.6 定义类传送门~点击

This rule detects instances where a finally statement does nothing.

简单解释:空的finally检查。

    void example() {Foo *foo;@try {[foo bar];}@catch(NSException *e) {NSLog(@"Exception occurred: %@", [e description]);}@finally            // empty finally statement, probably forget to clean up?{}}
5、empty for statement

      Since:0.6 定义类传送门~点击

This rule detects instances where a for statement does nothing.

简单解释:空的for语句检查。

    void example(NSArray *array) {for (;;)                // empty for statement{}for (id it in array)    // empty for-each statement{}}
6、empty if statement

      Since:0.2 定义类传送门~点击

This rule detects instances where a condition is checked, but nothing is done about it.

简单解释:空的if检查。

    void example(int a) {if (a == 1)                  // empty if statement{}}
7、empty switch statement

      Since:0.6 定义类传送门~点击

This rule detects instances where a switch statement does nothing.

简单解释:空的switch检查。

    void example(int i) {switch (i)              // empty switch statement{}}
8、empty try statement

      Since:0.6 定义类传送门~点击

This rule detects instances where a try statement is empty.

简单解释:空的try检查。

    void example() {try                     // but this try statement is empty{}catch(...) {cout << "Exception is caught!";}}
9、 empty while statement

      Since:0.6 定义类传送门~点击

This rule detects instances where a while statement does nothing.

简单解释:空的while检查。

    void example(int a {while(a--)              // empty while statement{}}

这篇关于OCLint的部分规则(Empty 部分)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1080181

相关文章

关于Gateway路由匹配规则解读

《关于Gateway路由匹配规则解读》本文详细介绍了SpringCloudGateway的路由匹配规则,包括基本概念、常用属性、实际应用以及注意事项,路由匹配规则决定了请求如何被转发到目标服务,是Ga... 目录Gateway路由匹配规则一、基本概念二、常用属性三、实际应用四、注意事项总结Gateway路由

Redis 多规则限流和防重复提交方案实现小结

《Redis多规则限流和防重复提交方案实现小结》本文主要介绍了Redis多规则限流和防重复提交方案实现小结,包括使用String结构和Zset结构来记录用户IP的访问次数,具有一定的参考价值,感兴趣... 目录一:使用 String 结构记录固定时间段内某用户 IP 访问某接口的次数二:使用 Zset 进行

poj 2976 分数规划二分贪心(部分对总体的贡献度) poj 3111

poj 2976: 题意: 在n场考试中,每场考试共有b题,答对的题目有a题。 允许去掉k场考试,求能达到的最高正确率是多少。 解析: 假设已知准确率为x,则每场考试对于准确率的贡献值为: a - b * x,将贡献值大的排序排在前面舍弃掉后k个。 然后二分x就行了。 代码: #include <iostream>#include <cstdio>#incl

笔记整理—内核!启动!—kernel部分(2)从汇编阶段到start_kernel

kernel起始与ENTRY(stext),和uboot一样,都是从汇编阶段开始的,因为对于kernel而言,还没进行栈的维护,所以无法使用c语言。_HEAD定义了后面代码属于段名为.head .text的段。         内核起始部分代码被解压代码调用,前面关于uboot的文章中有提到过(eg:zImage)。uboot启动是无条件的,只要代码的位置对,上电就工作,kern

Adblock Plus官方规则Easylist China说明与反馈贴(2015.12.15)

-------------------------------特别说明--------------------------------------- 视频广告问题:因Adblock Plus的局限,存在以下现象,优酷、搜狐、17173黑屏并倒数;乐视、爱奇艺播放广告。因为这些视频网站的Flash播放器被植入了检测代码,而Adblock Plus无法修改播放器。 如需同时使用ads

项目实战系列三: 家居购项目 第四部分

购物车 🌳购物车🍆显示购物车🍆更改商品数量🍆清空购物车&&删除商品 🌳生成订单 🌳购物车 需求分析 1.会员登陆后, 可以添加家居到购物车 2.完成购物车的设计和实现 3.每添加一个家居,购物车的数量+1, 并显示 程序框架图 1.新建src/com/zzw/furns/entity/CartItem.java, CartItem-家居项模型 /***

码蹄集部分题目(2024OJ赛9.4-9.8;线段树+树状数组)

1🐋🐋配对最小值(王者;树状数组) 时间限制:1秒 占用内存:64M 🐟题目思路 MT3065 配对最小值_哔哩哔哩_bilibili 🐟代码 #include<bits/stdc++.h> using namespace std;const int N=1e5+7;int a[N],b[N],c[N],n,q;struct QUERY{int l,r,id;}que

关于断言的部分用法

1、带变量的断言  systemVerilog assertion 中variable delay的使用,##[variable],带变量的延时(可变延时)_assertion中的延时-CSDN博客 2、until 的使用 systemVerilog assertion 中until的使用_verilog until-CSDN博客 3、throughout的使用   常用于断言和假设中的

牛客小白月赛100部分题解

比赛地址:牛客小白月赛100_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ A.ACM中的A题 #include<bits/stdc++.h>using namespace std;#define ll long long#define ull = unsigned long longvoid solve() {ll a,b,c;cin>>a>>b>

VB和51单片机串口通信讲解(只针对VB部分)

标记:该篇文章全部搬自如下网址:http://www.crystalradio.cn/thread-321839-1-1.html,谢谢啦            里面关于中文接收的部分,大家可以好好学习下,题主也在研究中................... Commport;设置或返回串口号。 SettingS:以字符串的形式设置或返回串口通信参数。 Portopen:设置或返回串口