Assignment Branch Condition Size For Is Too High Robocop

The New York City Police Department (NYPD) is structured into numerous bureaus and units. As a whole, the NYPD is headed by the Police Commissioner, a civilian administrator appointed by the Mayor, with the senior sworn uniformed officer of the service titled "Chief of Department". The Police Commissioner appoints a number of Deputy and Assistant Commissioners. The Department is divided into twenty bureaus, six of which are enforcement bureaus. Each enforcement bureau is further sub-divided into sections, divisions, and units, and into patrol boroughs, precincts, and detective squads. Each Bureau is commanded by a Bureau Chief (such as the Chief of Patrol and the Chief of Housing). There are also a number of specialized units (such as the Technical Assistance Response Unit) that are not part of any of the Bureaus and report to the Chief of the Department.

Leadership[edit]

The Department is headed by and under the control of a civilian Police Commissioner, who is appointed by the Mayor of New York City. The current Police Commissioner is James P. O'Neill.

The Department's executive staff is divided into two areas: civilian and uniformed. The civilian staff are responsible for support services and departmental management, while uniformed officers investigate crimes and conduct law enforcement operations.

  • The First Deputy Commissioner, who is the Department's second-in-command, oversees the civilian Deputy Commissioners and is the Department's chief administrative officer. The current First Deputy Commissioner is Benjamin B. Tucker.
  • The Chief of the Department supervises uniformed police commanders. The chief is the Department's highest ranking uniformed police officer and the lead official responsible for operations. The current chief is Terence Monahan.[1]

Office of the Police Commissioner[edit]

  • Commissioner
  • Chief of Staff
    • First Deputy Commissioner
      • Deputy Commissioner, Administration
      • Deputy Commissioner, Collaborative Policing
      • Deputy Commissioner, Intelligence & Counterterrorism
      • Deputy Commissioner, Internal Affairs
      • Deputy Commissioner, Management and Budget
      • Deputy Commissioner, Information Technology
      • Deputy Commissioner, Legal Matters
      • Deputy Commissioner, Department Advocate
      • Deputy Commissioner, Strategic Communications
      • Deputy Commissioner, Public Information
      • Deputy Commissioner, Trials
      • Deputy Commissioner, Equal Employment Opportunity
      • Deputy Commissioner, Labor Relations
      • Deputy Commissioner, Support Services

Office of the Chief of Department[edit]

  • Chief of Department
    • Chief, Community Affairs Bureau
    • Chief, Patrol Services Bureau
    • Chief, Crime Control Strategies
    • Chief, Transportation Bureau
    • Chief, Housing Bureau
    • Chief, Transit Bureau
    • Chief, Detective Bureau
    • Chief, Special Operations
    • Chief, Counterterrorism Bureau
    • Chief, Intelligence Bureau
    • Chief, Personnel Bureau
    • Chief, Strategic Initiatives
    • Chief, Training
    • Supervising Chief Surgeon

Structure[edit]

The following is the Department's hierarchy (with rank insignia): As of January, 2018:

  • Mayor of the City of New York - Bill de Blasio
  • Police Commissioner of the City of New York – James P. O'Neill
    • Chief of Staff – Raymond Spinella
  • First Deputy Commissioner – Benjamin B. Tucker
      • Commanding Officer of First Deputy Commissioner's Office Assistant Chief Mathew V. Pontillo
      • Deputy Commissioner, Administration – Robert L. Ganley
        • Commanding Officer of Ceremonial Unit - Lieutenant Tony Giorgio
        • Commanding Officer of Chaplains Unit - Lieutenant Steven A. Jerome
      • Deputy Commissioner, Collaborative Policing – Francesca A. Herman
      • Deputy Commissioner, Intelligence & Counterterrorism – John Miller
      • Deputy Commissioner, Internal Affairs – Joseph J. Reznick
      • Deputy Commissioner, Management and Budget – Vincent D. Grippo
      • Deputy Commissioner, Information Technology – Jessica S. Tisch
      • Deputy Commissioner, Legal Matters – Lawrence Byrne
      • Deputy Commissioner, Department Advocate – Kevin S. Richardson
      • Deputy Commissioner, Strategic Communications – William W. Andrews
      • Deputy Commissioner, Public Information – Stephen P. Davis
      • Deputy Commissioner, Trials – Rosemarie Maldonado
      • Deputy Commissioner, Equal Employment Opportunity – Neldra M. Zeigler
      • Deputy Commissioner, Labor Relations – John P. Beirne
      • Deputy Commissioner, Support Services Bureau – Robert S. Martinez
    • Chief of Department – Terence Monahan

Patrol Services Bureau[edit]

  • Commanding Officer of Patrol Services – Bureau Chief Rodney Harrison
    • Executive Officer of Patrol Services - Assistant Chief Fausto Pichardo

Overview[edit]

The Patrol Services Bureau is one of the most visible units of the NYPD. The Bureau plans, directs, and coordinates the Department's uniformed officers in law enforcement patrol operations. Under the Chief of Patrol, there are eight Borough Commands, each headed by an Assistant Chief. While each of the boroughs has at least one Patrol Borough Command, the boroughs of Manhattan, Queens and Brooklyn have two commands due to their sizes. The Borough Commands exercise authority over the various seventy-seven Police Precincts.

Police precincts[edit]

Each patrol borough is composed of precincts. Each precinct is responsible for safety and law enforcement within a designated geographic area. Police units based in these precincts patrol and respond to emergencies.

Staten Island now has four precincts: the 120th, 121st (new as of 2013),[79] 122nd, and 123rd. There are plans to begin construction in 2014 on a new building for the 120th precinct.

Queens South began operating a satellite for the large 105th precinct in the southern part of the precinct next to the Rosedale LIRR station in July 2007.[80] This building was, until then, the quarters for the Queens South Task Force, the Queens South Auto-Larceny Unit, the Queens South Anti-Crime Unit, the Queens South Evidence Collection Team, and the Detective Bureau's Queens Major Case Squad. The New 116th precinct would be built on the site of the parking lot next door to the satellite.

Auxiliary Police[edit]

Main article: New York City Police Department Auxiliary Police

  • Commanding Officer of Auxiliary Police Section – Inspector Phylis S. Byrne

The NYPD has a reserve police force known as the Auxiliary Police. NYPD Auxiliary Police officers complete a training Academy designated by the NYS Municipal Police Training Council as "part time peace officer" training course. In accordance with New York State law Auxiliary Police Officers are equipped with Police batons. They also carry Police radios and in accordance with NYC administrative code they carry handcuffs. They assist the Police Department with uniformed patrols and provide crowd and vehicular control at special events, accidents, and fire scenes.

Special Operations Bureau[edit]

  • Commanding Officer of Special Operations – Bureau Chief Harry Wedin

Emergency Service Unit[edit]

Main article: New York City Police Department Emergency Service Unit

  • Commanding Officer of Emergency Service Unit – Deputy Chief Vincent Giordano

The Emergency Service Unit,[81] a component of the Special Operations Bureau, provides specialized support and advanced equipment to other NYPD units.

Members of "ESU" are cross trained in multiple disciplines for police and rescue work. The ESU Canine Unit helps with searches for perpetrators and missing persons. The Emergency Service Unit also functions as a Special Weapons and Tactics Unit (SWAT) and NYPD hostage negotiators assist and secure the safety of hostages. The Emergency Services Unit works with other departments such as the FDNY with water rescues, suicide-jumpers, structural collapse rescues, and vehicle accidents. The ESU also has jet skis and numerous Zodiac inflatable rafts assigned to units throughout the precincts of NYC.

Aviation Unit[edit]

  • Commanding Officer of Aviation Unit – Deputy Inspector James Coan

Founded in 1928, it claims the distinction of being the oldest police aviation unit in the world, but there is a competing claim from the London Metropolitan Police Service ("The Met"). Based in Brooklyn, the Aviation Unit responds to various emergencies and tasks, supporting other units of the N.Y.P.D. Among its capabilities are the deployment of divers for water rescues. From a standing start, the unit claims it can be anywhere in the five boroughs within 15 minutes, but this has been disputed and is dependent on weather conditions and air traffic congestion.[82]

Since 9/11 the department has undertaken a major overhaul of the Aviation Unit. Once equipped exclusively with Bell helicopters, it recently re-equipped its fleet with four Agusta A 119 Koala helicopters, and three Bell 412 helicopters. And more recently the department purchased four brand new Bell 429 helicopters, replacing the Agusta helicopters. The centerpiece is a $9.8 million "unmarked" helicopter, which can fly at night without lights. However, this function will require approval from the Federal Aviation Administration and local Air Traffic Control on a case-by-case basis, due to the hazards it could present in the heavily congested New York air corridors. The department has also purchased a state-of-the-art helicopter flight simulator, so officers can practice flying without actually having to take up a helicopter.[83] In 2011 the department said they had .50 caliber machine guns capable of shooting down light planes.[84]

Famed US cyclistMile-a-Minute Murphy claimed to be the first police officer able to fly a plane in the US (possibly the entire world) as of 1914 as a member of the NYPD. He envisioned the use of airplanes to fight crime around the same time, though the Aviation Unit came into being 11 years after Murphy retired.

Harbor Unit and Scuba Team[edit]

  • Commanding Officer of Harbor Unit – Inspector David T. Driscoll

On March 15, 1858, five members of the New York City Police Department rowed out into New York Harbor to combat piracy aboard merchant ships lying at anchor. The NYPD Harbor Unit has existed ever since, protecting life and property. With hundreds of miles of inland waterways to cover, the unit operates over 36 boats from four bases.[85]

For underwater work, the department used to contract with private diving companies when weapons or other evidence had to be recovered from the bottom of New York's many rivers and waterways. In the early 1970s, however, the Harbor Unit formed a specialized scuba team that today numbers around 30 officers. Unlike many police dive units, whose members dive only part-time, NYPD divers are assigned to the unit full-time. (The exception are some scuba-trained officers in regular patrol units who are detailed to the team temporarily during the busy summer months.)[86] In addition to the normal duties of evidence recovery, the Scuba Team's mission has expanded since 9/11 to include a counter-terrorism role. For air-sea rescue work, the Harbor Unit keeps two divers assigned to the Aviation Unit 24 hours a day, seven days per week, all year round. These divers will work with their counterparts in the FDNY, who arrive at incidents by fireboat or rescue company.

Mounted Unit[edit]

  • Commanding Officer of Mounted Unit – Deputy Inspector Barry M. Gelbman

The NYPD Mounted Unit was created in 1858 and is used today in the Patrol units. The unit has 80 uniformed officers and supervisors and approximately 75 horses.

Strategic Response Group[edit]

Commanding Officer of Strategic Response Group - Inspector John J. D'Adamo

The Strategic Response Groups are organized within each borough and specialize in rapid mobilization. The Strategic Response Group responds to citywide mobilizations, civil disorders and major events with equipment and trained teams. They maintain order by implementing effective crime and crowd control strategies.

The Strategic Response Group conducts daily counterterrorism deployments in conjunction with other Department units based upon current intelligence and threat assessments. They identify and suppress terrorist surveillance of targets through mobile deployment teams. They respond quickly and decisively to terrorist incidents or threats.

The Strategic Response Group can be deployed to precincts and zones to supplement patrol resources or other Department initiatives.

The Strategic Response Group is organized as follows:

  • SRG 1 Manhattan
  • SRG 2 Bronx
  • SRG 3 Brooklyn
  • SRG 4 Queens
  • SRG 5 Staten Island

Transit Bureau[edit]

  • Commanding Officer of Transit – Bureau Chief Edward Delatorre

Further information: New York City Transit Police

The NYPD Transit Bureau is a part of the NYPD that patrols and responds to emergencies within the New York City transit system. Its responsibility includes the New York City Subway network in Manhattan, the Bronx, Brooklyn, and Queens. However, there are certain units that have citywide responsibilities such as the Homeless Outreach Unit and the Vandals Task Force.

The Transit Bureau is divided into Transit Borough Commands. These Borough Commands generally follow the boundaries of the City's geographical boroughs, although there are some notable exceptions. Since there are no subways on Staten Island, there are only four Transit Boroughs: Queens, Bronx, Brooklyn, and Manhattan. Each Transit Borough is further divided into Transit Districts.

As a general rule, each Borough is commanded by an Inspector while Transit Districts tend to be commanded by Captains. The NYPD Detective Bureau investigates all crimes that occur in Transit. Each borough office has assigned detectives from the Detective Bureau similar to the Precinct Detective Squad. As of June 15, 2006 all detectives assigned to investigate transit crimes fall under a unified command (Central Robbery Section) of the Detective Bureau's Special Investigations Division.

Housing Bureau[edit]

  • Commanding Officer of Housing – Bureau Chief James A. Secreto

Main article: New York City Police Department Housing Bureau

Further information: New York City Housing Authority Police Department

NYPD Mounted Unit officers patrol on horseback (New Year's Eve 2005/06)

Understanding Assignment Branch Condition

Recently, I integrated Rubocop into my work flow and it’s been very humbling. I feel I’m a great coder with all the specs passing and doing a good job of refactoring, Rubocop always finds something wrong with my code.

I usually go back and make fixes based on Rubocop’s suggestions, but I keep running into the same few issues and solving them isn’t as easy as using: (which auto-corrects all the easy ones!)

The toughest offense for me so far: Assignment Branch Condition

This offense is harder to fix really make me think about my coding style in general. I want to learn more about this offense to help me understand. By understanding, my goals is to not make this offense so often and/or make it easier for me to fix in the future.

What is: ABC?

Rubocop message:

The default is 15 and the first pass of my code is always way past this, probably on average twice this value. So cleaning up my code to meet the default value really takes a lot of work.

From the documentation:

Really Understanding: ABC

Let’s understand what ABC is by checking out the definition of ABC:

Broken down:

  • assignments (anything with )
  • branches (anything that jumps out of the current method)
  • conditionals (anything that tests logic , , unary )

SO, to reduce the ABC value, reduce assignments (use less intermediate variables), fewer branches (calling other methods), and conditionals (if/else statements).

Computing ABC

The ABC value is not just a counting of them, but a square root of the sum of their squares. If any one of them getting too high will spike the ABC count.

The Rubocop default for ABC metric is 15. What does 15 really mean?

Well, doing the math, to get an ABC score of 15, a method would have:

  • 8 assignments
  • 8 branches
  • 8 conditionals

(Just working backwards from 15*15 => 225; 225/3 => 75; Math.sqrt(75) ~=> 8.66)

Now that I lay it out that way, an ABC value of 15 is very reasonable. Having eight of each for a method is just enough to do a lot of work in a method, but a value of 15 keeps the method from spiraling out of control in assignments, branches, or conditionals.

Conclusion

Whenever I encountered Rubocop’s ‘ABC is too high’ message, I was annoyed with ABC metric because I didn’t understand how it was computed and I couldn’t refactor efficiently to lower the ABC value quickly.

Now that I spent some effort into researching what Assignment Branch Condition really means, I feel better about creating or refactoring code that has a better ABC score.

0 thoughts on “Assignment Branch Condition Size For Is Too High Robocop

Leave a Reply

Your email address will not be published. Required fields are marked *