Code Analysis Code Analysis
Code Analysis Code Analysis
DocFX + Singulink = ♥

Search Results for

    All Diagnostics

    Every warning of the analyzer has a diagnostic ID of the form SCA1001. Each kind of rule has its own thousand: the SCA1000s are the non-copyable rules. All are in the category Reliability, and each ID links to an article with an example and the ways to fix it.

    Didn't add these analyzers yourself? See Why Am I Seeing This?

    Copies

    ID What it warns about
    SCA1001 A stored value is assigned to a variable, a field or an element, which copies it
    SCA1002 A stored value, or a variable that lives on, is returned by value
    SCA1003 A stored value is passed by value, or used in another way that may copy it
    SCA1004 A stored value is boxed: converted to object or an interface
    SCA1005 MemberwiseClone copies an object or a struct that holds a non-copyable value
    SCA1006 A member that is not readonly runs on a copy, behind a read-only reference
    SCA1007 RuntimeHelpers.GetObjectValue, which clones a boxed struct, is used
    SCA1008 MemberwiseClone is called on a class that another assembly can derive from
    SCA1009 A class whose base class clones itself, such as Encoding, holds or binds a non-copyable value, or an object of such a class is used in a way that lets other code clone it

    Declarations

    ID What it warns about
    SCA1010 A field of a non-copyable type is declared in a copyable struct or a record
    SCA1011 An auto-property has a non-copyable type
    SCA1012 An iterator that returns a sequence takes a non-copyable value by value
    SCA1013 A non-copyable struct leaves an interface member to its default implementation
    SCA1014 A non-copyable struct has an async or iterator instance member that is not readonly
    SCA1015 An await uses an awaiter of a non-copyable type

    Generic and Unchecked Code

    ID What it warns about
    SCA1020 A member of a generic that is not marked is used with a non-copyable type, and is not on the symbol list
    SCA1021 A member marked [RequiresCopyable] is used with a non-copyable type
    SCA1022 A container is used as an Array or a non-generic collection
    SCA1023 A container is converted to a type that hides what it holds
    SCA1024 Code that was not built with the analyzer gets at a non-copyable value other than by value
    SCA1025 A referenced assembly that was not built with the analyzer can use a non-copyable type

    Containers

    ID What it warns about
    SCA1030 A value is read by value out of a list, a task or another container that still holds it
    SCA1031 A method returns a container that something else still holds
    SCA1032 A method keeps a container parameter that is not marked [Kept]
    SCA1033 A container is moved out of something that is not a local the method owns

    Marks and Configuration

    ID What it warns about
    SCA1040 An override, an implementation or a delegate does not keep a mark of the member that it stands for
    SCA1041 A [MovedFrom] parameter is used wrongly
    SCA1042 A line of a symbol list file cannot be parsed, or has no effect
    SCA1043 A type that derives from an erasable type does not stay erasable
    SCA1044 An attribute of the analyzer is declared [Conditional]
    SCA1045 A NonCopyableAttribute that the analyzer does not read
    SCA1046 [NotNullRef] where it does not count
    SCA1047 [NotNullRef] on a method of the project, to verify and then suppress
    SCA1048 A member that is nested too deeply for the analyzer, and was not checked
    © Singulink. All rights reserved.