Armed police were called to School Close in Sharlston last Thursday following reports of shots being fired.
Police said two windows at the downstairs flat were damaged during the incident, which happened at 12.12am.
They said no-one was hurt in the incident.
And now four men - two 29-year-olds and the others aged 31 and 26 - have been arrested and bailed by officers in connection with the incident.
Three of the men were arrested on suspicion of possession of a firearm with intent to cause fear of violence.
The 29-year-old was arrested on suspicion of assisting an offender.
Detective Chief Inspector Nicola Bryar, from West Yorkshire Police’s Homicide and Major Enquiry Team, said fire arms discharges are “extremely rare” in the district, and that it is believed to be an isolated incident.
Anyone with any information should contact 101.