[Mono-dev] [ANN] Smokey-0.6.0.0 Assembly Analyzer
Jesse Jones
jesjones at mindspring.com
Wed Sep 26 06:50:56 EDT 2007
Smokey is a command line tool used to analyze assemblies and report
problems. Problems include buggy code (e.g. infinite recursion, null
deref, malformed format string), performance issues (e.g. string
concatenation in loops, excessive boxing, large structs), violations
of the .NET design guidelines (e.g. inheriting from
ApplicationException or ICloneable, naming, and swallowing
exceptions), and miscellaneous rules like misspelled words in string
literals.
You can download Smokey from the web site: <https://home.comcast.net/
~jesse98/public/Smokey>. The web site also has an html report for one
of the System assemblies and a list of all of Smokey's rules.
Changes from Smokey 0.5.0.0:
* Added 23 new rules:
- AttributeProperties, attributes need getters for required
arguments and
getters/setters for optional arguments.
- AvoidEmptyInterfaces, use attributes instead of tagging types
with empty
interfaces.
- CLSCompliant, assemblies should use CLSCompliantAttribute.
- CompareTo, class implements IComparable but doesn't override
Equals.
- EventHandler, use EventHandler instead of writing event
delegates yourself.
- EventSignature, event delegates should use the standard
delegate signature.
- ExceptionConstructors, exceptions need constructors for inner
exceptions
and for remoting.
- HiddenMethod, derived method has a different signature but
still hides a
base class method.
- ImplementGenericCollection, use the generic IEnumerable.
- NativeMethods, p/invokes should be in a class name NativeMethods,
SafeNativeMethods, or UnsafeNativeMethods.
- ObsoleteMessage, ObsoleteAttribute usage doesn't set Message
property.
- OverridenFinalizer, don't override finalizers if the base
class implements
IDisposable.
- PublicAbstractCtor, abstract classes should not have public
ctors.
- SerializeException, exceptions should be serializable.
- SerializeExceptionMembers, exceptions with fields should override
GetObjectData.
- STAThread, main should use STAThreadAttribute.
- TypedCollection, use the generic ICollection.
- TypedDictionary, use the generic IDictionary.
- TypedEnumerator, use the generic IEnumerator.
- TypedList, use the generic IList.
- UseBaseTypes, don't pass a derived type into a method if a
base type will
work.
- UseFlagsAttribute, enums should use FlagsAttribute where
appropiate.
- UseStrongName, assemblies should have strong names.
* Assemblies can now define a DisableRuleAttribute and use it to
disable rules
for types and methods in that assembly (see the README for more
details).
* DisposeNativeResources and DisposableButNoFinalizer check for
HandleRef
in addition to IntPtr and UIntPtr.
* BumpBuildNumber.sh is now included in the tarball.
-- Jesse
More information about the Mono-devel-list
mailing list