Wikipedia notes that "Razors were often featured in the songs and came to symbolize Blacks' wanton tendencies." The source given for this claim is an article by James H. Dorman.
I get the implication of the razor symbolism (i.e., Black people are inherently violent, etc.), but what are its origins? Why a razor? Was there a well-publicized event in which an African-American was accused of a crime committed with a razor?
EDIT: Here is a video presenting examples of the razor trope. There's a particularly bizarre example at 19:16 in which potential enlistees for the American military propose to use their razors as weapons in WWI.
I've been doing a bit of research on American theater lately, and I remembered a reference to razors in A History of African American Theatre by Errol Hill (Cambridge University Press, 2003).
Hill says that it's because blacks weren't allowed to carry guns at the time, so razors became a common form of personal protection. See page 141, footnote 15, which can be found on page 505. The footnote does not itself provide a source for this claim, unfortunately. Razors are frequent weapons used by black men in popular culture (I am thinking in particular of the 1976 blacksploitation horror film J.D.'s Revenge), so I guess that tracks. I bet that if it was indeed the case in the actual Black Codes that you could track such a law down, but I don't know too much about the specifics of the Black Codes.