Hey everyone! I've been working on getting rid of our build warnings - stylecop and compiler.
There are 3 categories of warnings left, and I need your help on deciding how to fix those 😄
1. SA1649 - File name must match first type name (4)
This is happening for all classes where we have a generic version and a regular version which share the same name - Brushes, ImageBrush, etc. and we use the convention of {name}`{numberOfTypes}.cs for the file name.
The options I see are:
- keep the convention and ignore the warning for this specific case
- get rid of the convention and rename the generic and non generic versions
I would personally like a better distinction between the T and non T versions, and that would also help with the readability of the code.
2. SA1401 - Field must be private (4)
This is happening in JpegDecoderCore only, where we have some internal fields, like below.
/// <summary>
/// The byte buffer.
/// </summary>
internal Bytes Bytes;
This is a maintainability rule - the best practice is to keep all fields to private, and if anything needs to be exposed it should be done via properties.
Should we change these fields to properties? I'm not very familiar with this code so I'm hoping you will have more reasons for one option or the other.
3. CS0219 - The variable <> is assigned but its value is never used (4)
This is in the test project in ReferenceImplementations. r0 and r4 variables are never used. The fix to remove them is trivial, but I was wondering if them not being used is actually intentional.
Hey everyone! I've been working on getting rid of our build warnings - stylecop and compiler.
There are 3 categories of warnings left, and I need your help on deciding how to fix those 😄
1. SA1649 - File name must match first type name (4)
This is happening for all classes where we have a generic version and a regular version which share the same name - Brushes, ImageBrush, etc. and we use the convention of
{name}`{numberOfTypes}.csfor the file name.The options I see are:
I would personally like a better distinction between the T and non T versions, and that would also help with the readability of the code.
2. SA1401 - Field must be private (4)
This is happening in
JpegDecoderCoreonly, where we have some internal fields, like below.This is a maintainability rule - the best practice is to keep all fields to private, and if anything needs to be exposed it should be done via properties.
Should we change these fields to properties? I'm not very familiar with this code so I'm hoping you will have more reasons for one option or the other.
3. CS0219 - The variable <> is assigned but its value is never used (4)
This is in the test project in
ReferenceImplementations. r0 and r4 variables are never used. The fix to remove them is trivial, but I was wondering if them not being used is actually intentional.