Vous êtes sur la page 1sur 3

Lab 8 FxCop 1.

36 Analysis Report Medication in hospital


Expand All Collapse All

{} madication (2)

]2 Messages for madication


Message Level

Certainty Resolution Correct the casing of 'madication' in namespace name 'madication' by changing it to Error 85 'Madication'. Rule: Identifiers should be cased correctly Category: Microsoft.Naming Check Id: CA1709 Type, namespace, and member identifiers are Pascal-cased. Parameter identifiers are camelcased. Two letter acronyms within these identifiers should be upper-cased, for example, use System.IO instead of System.Io. Acronyms of three or more letters should be Pascal-cased, for example, use System.Xml instead of System.XML. The pascal-casing convention capitalizes the first letter of each word, as in BackColor. The camel-casing convention formats the first letter of Rule the first word in lowercase and capitalizes the first letter of all subsequent words, as in Description: backgroundColor. Although it may be common practice for some two letter acronyms to not be fully capitalized, violations of this rule should not be excluded for this reason. For example, 'DbConnection', is common but incorrect; use DBConnection. A violation of this rule might be required for compatibility with existing, non-managed symbol schemes. In general, however, these symbols should not be visible outside the assembly that uses them. Rule File: NamingRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182240(VS.90).aspx Correct the spelling of 'madication' in namespace name 'madication'. CriticalWarning 75 Rule: Category: Check Id: Rule Description: Rule File: Help: Identifiers should be spelled correctly Microsoft.Naming CA1704 The individual words that make up an identifier should not be abbreviated and should be spelled correctly. If this rule generates a false positive on a term that should be recognized, add the word to the FxCop custom dictionary. NamingRules.dll [9.0.0.0] http://msdn2.microsoft.com/library/bb264492(VS.90).aspx

2$(ProjectDir)/Madication.exe (8) 1madication.exe (8)


Message Level

]5 Messages for madication.exe

CriticalError Rule: Category: Check Id:

Certainty Resolution Sign 'Madication.exe' with a strong name key. 95

Assemblies should have valid strong names Microsoft.Design CA2210 Either the assembly has no strong name, an invalid one, or the strong name is valid only because of the computer configuration. The assembly should not be deployed in this state. The most Rule common causes of this are: 1) The assembly's contents were modified after it was signed. 2) The Description: signing process failed. 3) The assembly was delay-signed. 4) A registry key existed that allowed the check to pass (where it would not have otherwise). Rule File: DesignRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182127(VS.90).aspx Correct the casing of 'madication' in assembly name 'Madication.exe' by changing it Error 85 to 'Madication'.

Identifiers should be cased correctly Microsoft.Naming CA1709 Type, namespace, and member identifiers are Pascal-cased. Parameter identifiers are camelcased. Two letter acronyms within these identifiers should be upper-cased, for example, use System.IO instead of System.Io. Acronyms of three or more letters should be Pascal-cased, for example, use System.Xml instead of System.XML. The pascal-casing convention capitalizes the first letter of each word, as in BackColor. The camel-casing convention formats the first letter of Rule the first word in lowercase and capitalizes the first letter of all subsequent words, as in Description: backgroundColor. Although it may be common practice for some two letter acronyms to not be fully capitalized, violations of this rule should not be excluded for this reason. For example, 'DbConnection', is common but incorrect; use DBConnection. A violation of this rule might be required for compatibility with existing, non-managed symbol schemes. In general, however, these symbols should not be visible outside the assembly that uses them. Rule File: NamingRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182240(VS.90).aspx Correct the spelling of 'madication' in assembly name 'Madication.exe'. CriticalWarning 75 Identifiers should be spelled correctly Microsoft.Naming CA1704 The individual words that make up an identifier should not be abbreviated and should be spelled Rule correctly. If this rule generates a false positive on a term that should be recognized, add the Description: word to the FxCop custom dictionary. Rule File: NamingRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/bb264492(VS.90).aspx Mark 'Madication.exe' with CLSCompliant(true) because it exposes externally visible Error 95 types. Rule: Mark assemblies with CLSCompliantAttribute Category: Microsoft.Design Check Id: CA1014 Assemblies should explicitly state their CLS compliance using the CLSCompliant attribute. An assembly without this attribute is not CLS-compliant. Assemblies, modules, and types can be Rule CLS-compliant even if some parts of the assembly, module, or type are not CLS-compliant. The Description: following rules apply: 1) If the element is marked CLSCompliant, any noncompliant members must have the CLSCompliant attribute present with its argument set to false. 2) A comparable CLS-compliant alternative member must be supplied for each member that is not CLS-compliant. Rule File: DesignRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182156(VS.90).aspx Because assembly 'Madication.exe' contains a ResX-based resource file, mark it with the NeutralResourcesLanguage attribute, specifying the language of the resources Warning 95 within the assembly. This could improve lookup performance the first time a resource is retrieved. Rule: Mark assemblies with NeutralResourcesLanguageAttribute Category: Microsoft.Performance Check Id: CA1824 The NeutralResourcesLanguage attribute informs the ResourceManager of the language used to render the neutral culture's resources for an assembly. When looking up resources in the same Rule culture as the neutral resources language, the ResourceManager automatically uses the resources Description: located in the main assembly, instead of searching for a satellite assembly with the current user interface culture for the current thread. This will improve lookup performance for the first resource you load and can reduce your working set. Rule File: PerformanceRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/bb385967(VS.90).aspx Rule: Category: Check Id:

Rule: Category: Check Id:

{} madication (3) <Form1 (3) L#button1_Click(System.Object,System.EventArgs) (3)


Message Level Certainty Resolution

]3 Messages for #button1_Click(System.Object,System.EventArgs)

6 4 4 4 4 4

6 4

Modify 'Form1.button1_Click(object, EventArgs)' to catch a more specific exception than 'Exception' or rethrow the exception. Rule: Do not catch general exception types Category: Microsoft.Design Check Id: CA1031 You should not catch Exception or SystemException. Catching generic exception types can hide Rule run-time problems from the library user, and can complicate debugging. You should catch only Description: those exceptions that you can handle gracefully. Rule File: DesignRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182137(VS.90).aspx Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Change 'Form1.button1_Click(object, EventArgs)' to call the MessageBox.Show overload that specifies MessageBoxOptions, and make sure to set MessageBoxOptions.RightAlign Error 95 and MessageBoxOptions.RtlReading if RightToLeft is set to RightToLeft.Yes on the parent control. Rule: Specify MessageBoxOptions Category: Microsoft.Globalization Check Id: CA1300 In order to run correctly on right-to-left systems, all calls to MessageBox.Show should use the Rule overload that specifies MessageBoxOptions as an argument. Programs should detect whether Description: they are running on a right-to-left system at run-time and pass the appropriate MessageBoxOptions value in order to display correctly. Rule File: GlobalizationRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182191(VS.90).aspx Replace the call to 'string.operator !=(string, string)' in 'Form1.button1_Click(object, Warning 95 EventArgs)' with a call to 'String.IsNullOrEmpty'. Replace the call to 'string.operator !=(string, string)' in 'Form1.button1_Click(object, Warning 95 EventArgs)' with a call to 'String.IsNullOrEmpty'. Rule: Test for empty strings using string length Category: Microsoft.Performance Check Id: CA1820 To test for empty strings, check if String.Length is equal to zero. Constructs such as Rule "".Equals(someString) and String.Empty.Equals(someString) are less efficient than testing the Description: string length. Replace these with checks for someString.Length == 0. Rule File: PerformanceRules.dll [9.0.0.0] Help: http://msdn2.microsoft.com/library/ms182279(VS.90).aspx CriticalError 95

Vous aimerez peut-être aussi