Let $R>S$ be finite Frobenius rings for which there exists a trace map $T:$ S$R \rightarrow$S$R$. Let $C$f,s$:=\{x \mapsto T(\alpha x + \beta f(x)) : \alpha, \beta \in R \}$. $C$f,s is an $S$-linear subring-subcode of a left linear code over $R$. We consider functions $f$ for which the homogeneous weight distribution of $C$f,s can be computed. In particular, we give constructions of codes over integer modular rings and commutative local Frobenius that have small spectra.