Code analysis, Lost between CA1709 and CA1704

[亡魂溺海] 提交于 2019-12-13 19:25:25

问题


Because of these two KB articles, I am confused:

  • CA1704: Identifiers should be spelled correctly
  • CA1709: Identifiers should be cased correctly

I have a property named ICD9. My code analysis says that I have to change it to Icd

That sounds reasonable to me. I go and change it to Icd9 (I am not sure why it's suggesting Icd not Icd9) and I get a different warning

The KB says if my acronym is three-letter long I should use Pascal casing. Isn't Icd9 Pascal cased? I feel that 9 has causing the issue.


回答1:


The first warning is because ICD is not the dictionary as an acronym, so it tells you not to use all caps.

The second warning is because ICD is not in the dictionary at all, so it thinks it is a misspelled word.

Either add ICD to the custom dictionary (as a normal word to get rid of the second warning or as a acronym and you can switch back to ICD9 and get rid of the first warning), or try to avoid short acronym names and use a longer more descriptive name for the property that uses words that are in the dictionary.



来源:https://stackoverflow.com/questions/31360535/code-analysis-lost-between-ca1709-and-ca1704

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!