RevJava critic description

This is an overview (generated from RevJava 0.8.3) describing the critics available.

Note that Type refers to the kind of program element a critic applies to. JType applies to both classes and interfaces.

Name = Abstract specialization
Type = JClass
Description = Abstract classes that are subclasses of concrete classes may indicate a problem.

Name = Turn into interface
Type = JClass
Description = Abstract classes that don't implement anything might be better of as an interface.

Name = Wrapped Datarecord
Type = JClass
Description = Classes with only getter/setter methods suggest inadequate behaviour distribution

Name = Datarecord
Type = JClass
Description = Classes with only attributes and no methods suggest inadequate behaviour distribution

Name = Behaviour
Type = JClass
Description = Classes that represent operations may have to be turned into methods of another class.

Name = God Class
Type = JClass
Description = Control should be decentralized over objects, not centralized in one class

Name = Module mimic
Type = JClass
Description = Classes should not be used for creating modules of functions.

Name = Factor out event listeners
Type = JClass
Description = Mixing event listeners with regular classes adds complexity; consider factoring them out to separate objects using inner or anonymous classes.

Name = Uninstantiable public
Type = JClass
Description = Public classes with no public constructor cannot be instantiated externally.

Name = Copious constructors
Type = JClass
Description = Classes with a lot of constructors may be difficult to understand. Simplify the creation protocol, e.g. by introducing Factory Methods.

Name = Move field definition
Type = JField
Description = Fields should be declared in the classes that deal with them.

Name = Cyclic usage
Type = JClass
Description = Cycles in the usage relation among classes should be avoided

Name = Highly coupled
Type = JMethod
Description = Methods that know about too many other types may have to be split up.

Name = Dependency cycles
Type = JPackage
Description = Package dependencies should not be cyclic

Name = Overly public type
Type = JType
Description = Public types not known by anyone outside the package should be package local.

Name = Remotely manipulated field
Type = JField
Description = An object's fields should not be manipulated by other objects. Provide methods to deal with this.

Name = Non private field
Type = JField
Description = Fields of objects that aren't accessed externally, should be declared private.

Name = Overly public field
Type = JField
Description = Fields that aren't accessed outside the package should have local scope.

Name = Non private method
Type = JMethod
Description = Methods not used by other classes should be declared private.

Name = Overly public method
Type = JMethod
Description = Methods not used by classes in other packages should not be declared public.

Name = Scope widening
Type = JMethod
Description = Making a method more visible than intended in the superclass may lead to confusion.

Name = Exposes collection structure
Type = JClass
Description = Exposing collections maintained in a class can lead to problems with uncoordinated updates, and/or may indicate insufficient abstractions. Consider exposing iterators or reorganize.

Name = Hardly hiding
Type = JPackage
Description = Packages with only (or mostly) public types may not try to encapsulate enough functionality.

Name = Unusable public field
Type = JField
Description = Public fields with a type that is not public cannot be used externally.

Name = Empty interface
Type = JClass
Description = Public classes with no public features don't present anything useful.

Name = Unusable public method
Type = JMethod
Description = Public methods with an argument/return type that is not public cannot be used externally.

Name = Remote field manipulation
Type = JMethod
Description = Methods that manipulate fields in other objects depend heavily on that object's internals. This should be avoided.

Name = Avoid finalizers
Type = JClass
Description = Finalizers may cause problems; attempt to avoid them

Name = Implement clone for Cloneable
Type = JClass
Description = Classes that implement the Cloneable interface, should implement the clone method.

Name = Define hashcode when defining equals
Type = JClass
Description = Classes that define an equals method might also need to define the hashcode method.

Name = Define equals when defining hashCode
Type = JClass
Description = Classes that define a hashCode method might also need to define the equals method.

Name = SubType Knowledge
Type = JType
Description = Types shouldn't know about their subtypes.

Name = Abstraction breaking
Type = JType
Description = Types shouldn't know about a type and its subtypes.

Name = Factory candidate
Type = JType
Description = Factories hide the instance creation of type hierarchies.

Name = Misplaced type
Type = JType
Description = Types not used in a package but only by one other package might have to be moved.

Name = Redefined as abstract
Type = JMethod
Description = A method inherited from a superclass is redefined as abstract. This may indicate a problem in your hierarchy.

Name = Ignores superclass behaviour
Type = JMethod
Description = A method implementation that fully overrides behaviour in a superclass may be an error.

Name = Subtype knowledge
Type = JMethod
Description = Methods should not know about sub-types of the type they're defined in.

Name = Unused superclass behaviour
Type = JMethod
Description = Unused superclass method implementations may need to be removed or reviewed.

Name = Inner type in interface
Type = JType
Description = Inner types should not be declared in interfaces.

Name = Exposed inner class
Type = JClass
Description = Inner classes with a wide scope may cause problems when a program is reorganized; consider making it a normal class or hide it.

Name = Non-static exposed inner class
Type = JClass
Description = Non-static inner classes with a wide scope may cause confusion; consider making it a normal class or static.

Name = Instantiated non-static inner class
Type = JClass
Description = Non-static inner classes may cause confusion if they are instantiated at random; consider making it a normal class or static.

Name = Law of Demeter (Weak class version)
Type = JMethod
Description = The method calls/accesses objects of classes itself and its superclasses don't know (implies strong class version).

Name = Law of Demeter (Strong class version)
Type = JMethod
Description = The method calls/accesses objects of classes itself doesn't know.

Name = Uninitialized field
Type = JField
Description = Fields that are not set/updated anywhere, but are referred to can cause problems.

Name = Local variable
Type = JField
Description = Fields used only in a single method may be better modelled as local variables in that method.

Name = Large Method
Type = JMethod
Description = The size of this method is above average?

Name = Move method
Type = JMethod
Description = Methods that don't access local features, but only use features of one other type may have to be moved to that other type.

Name = Move behaviour
Type = JMethod
Description = Methods that use a lot of features on another type suggest a new responsibility for that other type.

Name = Helper method
Type = JMethod
Description = Methods that don't call local methods or access local attributes may have to be turned into class methods.

Name = Many parameters
Type = JMethod
Description = Methods with a lot of parameters suggest inadequate object structures.

Name = Implicit constant
Type = JField
Description = Class fields that are initialized and not updated further should be final.

Name = Unconventional type name
Type = JType
Description = Type names should start with a capital letter.

Name = Constant naming
Type = JField
Description = Constants should have names only composed of uppercase letters, numbers and underscores.

Name = Field name redefinition
Type = JField
Description = Fields that have the same name as a field in a superclass may cause confusion.

Name = Replicated declaration
Type = JMethod
Description = Unrelated methods in the same hierarchy that have the same name/signature cause confusion.

Name = Unconventional method name
Type = JMethod
Description = Method names by convention start with a lowercase letter.

Name = Hides field
Type = JMethod
Description = Methods that have local variables/arguments with the name of an attribute may have strange effects.

Name = Closed package
Type = JPackage
Description = Packages without public types may not be (are not?) very useful.

Name = Unrelated types
Type = JPackage
Description = Packages with types that don't use each other may have to be reorganized.

Name = Make inner
Type = JType
Description = Types used only by one other type in one other package might better be an inner class.

Name = Incomplete singleton
Type = JClass
Description = Singletons should not allow public instance creation

Name = Illegally instantiated singleton
Type = JClass
Description = Singletons should not be instantiated by other classes.

Name = UI knowledge
Type = JType
Description = Non ui types should not know about ui types.

Name = Spread UserInterface knowledge
Type = JSystem
Description = User Interface functionality should be localized in the system.

Name = Spread IO knowledge
Type = JSystem
Description = I/O functionality should be localized in the system.

Name = Spread Database knowledge
Type = JSystem
Description = Database functionality should be localized in the system.

Name = Multiple entry points
Type = JSystem
Description = Entry points for the system should be localized in one package.

Name = No Instances
Type = JClass
Description = Leaf-classes that don't have instances may not be used anymore

Name = Unused type
Type = JType
Description = Types not known by anyone might have to be removed.

Name = Unused field
Type = JField
Description = Fields of objects (or classes) that are not used, might be superfluous.

Name = Unused method
Type = JMethod
Description = Unused methods may have to be removed.

Name = Unused package
Type = JPackage
Description = Packages whose types are not used may be obsolete

Name = Unread field
Type = JField
Description = Fields that are set but not read anywhere may have to be removed.

Name = Unused accessor
Type = JField
Description = Fields for which accessors are defined should not be manipulated directly.


Gert Florijn - Last modifed: 06/02/03