HMI found "unusually difficult problems" at Musselburgh, many of which were outside the school's control. Inspectors encountered fighting between rival gangs in a school whose letters are headed "Striving for Excellence - Caring for All".
About a third of pupils expressed concerns in a questionnaire about safety in school and said bullying was not dealt with.
A majority in the same survey did not feel behaviour in classes, corridors and playground was good. Almost all criticised the quality of the toilets and lack of attractive social areas.