OCLint的部分规则(Naming 部分)

本文介绍了OCLint中关于变量命名长度的两条规则:变量名过长和过短都会影响代码的可读性,并提供了具体的阈值设置。

OCLint的部分规则(Naming 部分)

对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、long variable name

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

Variables with long names harm readability.

简单解释:变量名较长,影响可读性。

    void aMethod() {
        int reallyReallyLongIntegerName;
    }

Thresholds:
LONG_VARIABLE_NAME The long variable name reporting threshold, default value is 20.

2、hort variable name

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

A variable with a short name is hard to understand what it stands for. Variable with name, but the name has number of characters less than the threshold will be emitted.

简单解释:变量名太短,影响可读性。

    void aMethod(int i)  // i is short
    {
        int ii;          // ii is short
    }

Thresholds:
SHORT_VARIABLE_NAME The short variable name reporting threshold, default value is 3.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值