A computer program product, encoded on one or more non-transitory computer storage media, comprising instructions that when executed by one or more computers of a source code analysis system cause the one or more computers to perform operations comprising:
- generating, by an analysis engine of the source code analysis system programmed to perform one or more source code analysis processes, a plurality of alerts for each project of a plurality of different software projects, wherein each alert represents a coding defect occurring in a respective software project analyzed by the analysis engine, and wherein each alert has one or more respective attribute values for one or more respective alert attributes;
- obtaining, by an alert weighting engine of the source code analysis system programmed to perform an alert weighting process, alerts previously generated by the analysis engine of the source code analysis system;
- generating, by the alert weighting engine from the alerts previously generated by the analysis engine of the source code analysis system, a respective sample of alerts for each feature of a plurality of features, each sample comprising alerts occurring in one or more of the plurality of different software projects, each alert having a particular attribute value corresponding to the feature, wherein each alert represents a coding defect occurring in one of the plurality of different software projects analyzed by the source code analysis system;
- computing, by the alert weighting engine for each sample of alerts corresponding to each attribute value and for each feature of a plurality of features, respective feature values for alerts having the attribute value for the feature;
- computing, by the alert weighting engine from the feature values computed for a feature of the plurality of features, a respective feature value distribution for each attribute value, wherein each respective feature value distribution for an attribute value maps each feature value of a plurality of feature values to a respective likelihood representing how likely it is for an alert having the attribute value to have the feature value for the feature;
- receiving, by the alert weighting engine, a request to rank a plurality of alerts by priority of addressing respective coding defects represented by the plurality of alerts, wherein the plurality of alerts is generated by one of the one or more source code analysis processes, wherein each alert of the plurality of alerts represents a respective coding defect of a software project and has one or more respective computed attribute values for one or more features of the plurality of features;
- obtaining, by the alert weighting engine for each feature of the plurality of features, an importance distribution that maps each feature value of one or more feature values for the feature to a respective measure of importance for an alert having the feature value;
- computing, by the alert weighting engine for each alert and for each feature, a respective feature value likelihood to which a feature value for the alert is mapped on the importance distribution;
- computing, by the alert weighting engine for each alert and for each feature, a respective feature score for the feature, the respective feature score being a value to which the computed feature value likelihood for the feature is mapped on the importance distribution for the feature;
- computing, by the alert weighting engine for each alert, a respective weight for the alert by combining the respective feature score for each feature computed for the alert;
- and
- providing, by the alert weighting engine, a response to the request comprising a ranking of the plurality of alerts according to the respective weights to indicate a priority of addressing respective coding defects represented by the alerts.