Xiaoven / codegex

A light-weight tools like spotbugs
GNU Lesser General Public License v2.1
1 stars 0 forks source link

False positives for NM_FIELD_NAMING_CONVENTION #113

Closed zhouyinn closed 3 years ago

zhouyinn commented 3 years ago

//https://github.com/tlaplus/tlaplus/pull/574/files https://github.com/tlaplus/tlaplus/pull/574/files #107
public static final BoolValue ValTrue = new BoolValue(true);
BoolValue.ValTrue;
Xiaoven commented 3 years ago

Enum

if (Constants.PinCodeMode.FRAME == codeMode) {
// def
public class Constants {
    public enum PinCodeMode {
        CROP, FRAME
    }
    public static final String EXTRA_MODE = "mode";
}

Def in Library

如果 ImageView.ScaleType.CENTER 是定义在 library 的,那么即使我们用了 online search,也是搜索不到的

默认priority是否需要设置为 ignore,只在一些特殊情况提升它的priority,如

  1. online search 搜到了它的定义
  2. obj.field1.field2...fieldn 类型的,只检查 fieldn,并且在 fieldn 前面的那个field是小写开头,才提高 priority
        ImageRequest imageRequest = new ImageRequest(
                img_urls.get(i),
                listener2, 50, 50, ImageView.ScaleType.CENTER,
                Bitmap.Config.ARGB_8888, null);
        queue.add(imageRequest);
    }

window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

Type

Constants.PinCodeMode pinCodeMode = (Constants.PinCodeMode)
                getIntent().getSerializableExtra(Constants.EXTRA_MODE);

定义 同上

In string

感觉要给所有跟string 无关的 patterns 都加上 string 过滤才行

                .append("         AND c.IsActive='Y') AND ")
zhouyinn commented 3 years ago
final int type = data.getIntExtra(RESULT_TYPEID, OfflineMap.OfflineMapType.DEFAULT);
// OfflineMap.OfflineMapType.DEFAULT is final