C#-FieldNotPrivateNorProtected

A field should be either private or protected

Required inputs: CSharpAST

Fields should be declared private or protected.

Possible Messages

Key

Text

Severity

Disabled

no_public_field

Field has neither private nor protected visibility.

None

False

Options

report_const_fields

report_const_fields : bool = False

Whether to report const fields.
 

report_fields_in_struct_layout_types

report_fields_in_struct_layout_types : bool = False

Whether to report fields in struct layout types.
 

report_fields_in_structs

report_fields_in_structs : bool = False

Whether to report fields in structs.
 

report_readonly_fields

report_readonly_fields : bool = False

Whether to report read-only fields.