(a) To formulate, propose, adopt and amend rules and regulations relating to (i) the construction, reconstruction, alteration, repair, demolition, removal, inspection, issuance and revocation of permits or licenses, installation of equipment, classification and definition of any building or structure and use or occupancy of all buildings and structures and parts thereof or classes of buildings and structures and parts thereof, except bridges and appurtenant supporting structures which have been or are to be constructed by or are under the custody and control of the department of highways, the Massachusetts Department of Transportation, the Massachusetts Bay Transportation Authority, the metropolitan district commission or the Massachusetts Port Authority or for which said agencies have maintenance responsibility; (ii) the rehabilitation and maintenance of existing buildings; (iii) the standards or requirements for materials to be used in connection therewith, including but not limited to provisions for safety, ingress and egress, energy conservation, and sanitary conditions; (iv) the establishment of reasonable fees for inspections, which fees shall be collected and retained by the city or town conducting such inspections. Such rules and regulations, together with any penalties for the violation thereof, as hereinafter provided, shall comprise and be collectively known as the state building code.
Whoever violates any provision of the state building code, except any specialized code as described in section ninety-six, shall be punished by a fine of not more than one thousand dollars or by imprisonment for not more than one year, or both, for each such violation. Each day during which a violation exists shall constitute a separate offense.