Skip to content

Fix StyleCop/compiler warnings  #48

@olivif

Description

@olivif

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions