Long Methods/Classes
static void generate_positive_edge_for_status_bit(unsigned int statusBit)
{
char tempStr[20];
unsigned int currentStatus;
unsigned int bit = (statusBit % 16);
unsigned int offsetRegister = statusControlRegister + (statusBit / 16);
/* Read touch screens Control Status Register (contents end up as a */
/* hex string in tempStr) */
getVSMRegisterValues(tempStr, offsetRegister, 1);
convert_ascii_hex_string_to_uint(tempStr, ¤tStatus);
/* If bit is already set we must clear it before setting it again. */
if (currentStatus & (0x0001 << bit))
{
/* Clear bit and write it to vsm */
SetOrClearVSMDataBit(¤tStatus, bit, CLEAR);
perform_vsm_write(offsetRegister, currentStatus);
}
/* After delay want to SET this bit, giving positive edge, */
start_delay_before_write_status(bit, SET);
} /* end of generate_positive_edge_for_status_bit */
NULL
public Person FindPersonFromId(int id)
{
if(database.RecordExists(id))
{
object record = database.RetrieveRecord(id);
if(record is Person)
return record as Person;
else
return null;
}
}
Duplication
private void PrintEventTimes(Event event)
{
System.Out.WriteLine(event.StartTime.ToString(“hh:mm:ss.fff”));
System.Out.WriteLine(event.EndTime.ToString(“hh:mm:ss.fff”));
}
Pattern over use
org.jboss.com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryProxyImpl
Multiple Responsibilities
private void SendDataAndPrintByteCount()
Comments
//If we have exceeded the maximum size
if(collection.Count >= 5)
Naming
button.Clicked += SendData;