NEW YORK, NY — The NYPD has long kept cops' disciplinary records close to its chest, shielding them from public view under the banner of state law. But BuzzFeed News gave New Yorkers a glimpse at how the Police Department punishes officers and other employees by publishing a cache of secret discipline files on Monday.

BuzzFeed posted a searchable database of disciplinary records for about 1,800 NYPD employees dating from between 2011 and 2015. The documents, which the site obtained from an anonymous source, aren't a "complete accounting" of police discipline from those years but show how the department handled offenses ranging from showing up to work late to drunk driving, BuzzFeed wrote. Based on these records, BuzzFeed reported last month that more than 300 police workers stayed on the job despite committing offenses that could have gotten them fired. The website decided to publish the database to give the public — including NYPD employees — an idea of how the city's police discipline system works.

"BuzzFeed News determined that there is an overwhelming public interest in these documents' release, and so we are publishing them in a format that is designed to be searchable by criminal defendants, police officers, scholars, and the public," BuzzFeed reporters Kendall Taggart and Mike Hayes wrote in an explanation of the website's decision. Section 50-a of the state Civil Rights Law shields police disciplinary records from public view. The NYPD wanted to start publishing summaries of how disciplinary hearings turned out, but a state judge blocked the move last week pending a June hearing in a lawsuit brought by the city's largest police union.

In a statement responding to BuzzFeed publishing the records, the NYPD touted the recent decline in substantiated complaints of misconduct against cops even as more officers joined the force. The department said it has also ramped up random "integrity testing" to make sure cops are following laws and NYPD guidelines and improved cooperation with prosecutors in recent years.

"The overwhelming majority of New York City cops come to work every day to do good, fight crime, and help people, making this City the safest it has been since the 1950s," the NYPD said in the statement. "For the few who commit violations, the NYPD's disciplinary process is more rigorous today than ever before."