Solar flares emanate from solar active regions hosting complex and strong bipolar magnetic fluxes. Estimating the probability of an active region to flare and defining reliable precursors of intense flares is an extremely challenging task in the space weather field. In this work, we focus on two metrics as flare precursors, the unsigned flux R, tested on MDI/SOHO data and one of the most used parameters for flare forecasting applications, and a novel topological parameter D representing the complexity of a solar active region. More in detail, we propose an algorithm for the computation of the R value which exploits the higher spatial resolution of HMI maps. This algorithm leads to a differently computed R value, whose functionality is tested on a set of cycle 24th solar flares. Furthermore, we introduce a topological parameter based on the automatic recognition of magnetic polarity-inversion lines in identified active regions, and able to evaluate its magnetic topological complexity. We use both a heuristic approach and a supervised machine learning method to validate the effectiveness of these two descriptors to predict the occurrence of X-or M-class flares in a given solar active region during the following 24 hours period. Our feature ranking analysis shows that both parameters play a significant role in prediction performances. Moreover, the analysis demonstrates that the new topological parameter D is the only one, among 173 overall predictors, which is always present for all test subsets and is systematically ranked within the top-ten positions in all tests concerning the computation of the weighs with which each predictor impacts the flare forecasting.