We report on a quantitative analysis of relationships between the number of homicides, population size and ten other urban metrics. By using data from Brazilian cities, we show that well-defined average scaling laws with the population size emerge when investigating the relations between population and number of homicides as well as population and urban metrics. We also show that the fluctuations around the scaling laws are log-normally distributed, which enabled us to model these scaling laws by a stochastic-like equation driven by a multiplicative and log-normally distributed noise. Because of the scaling laws, we argue that it is better to employ logarithms in order to describe the number of homicides in function of the urban metrics via regression analysis. In addition to the regression analysis, we propose an approach to correlate crime and urban metrics via the evaluation of the distance between the actual value of the number of homicides (as well as the value of the urban metrics) and the value that is expected by the scaling law with the population size. This approach has proved to be robust and useful for unveiling relationships/behaviors that were not properly carried out by the regression analysis, such as i) the non-explanatory potential of the elderly population when the number of homicides is much above or much below the scaling law, ii) the fact that unemployment has explanatory potential only when the number of homicides is considerably larger than the expected by the power law, and iii) a gender difference in number of homicides, where cities with female population below the scaling law are characterized by a number of homicides above the power law.