calculate_features_from_versions: Calculate features from combinations of PMD alerts of a new...

Description Usage Arguments Value

View source: R/functions.R

Description

Reads or gets as input two versions of source codes, a new and an old, and returns the info about the alerts and the combination between the alerts. The main output are the features related to combinations of an alerts: an alert from the new version and an alert from the old version. All the combinations between an old alert and a new alert are considered. The main goal is to differentiate between Fixed, Old and New alerts. If a combination of alerts from the new and the old versions have many features that indicate they have the same role in the code, the alert in the new version may be considered an old alert.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
calculate_features_from_versions(
  code_file_new = "",
  code_file_old = "",
  code_new = "",
  code_old = "",
  pmd_path,
  rule_path = "rulesets/java/quickstart.xml",
  blockrules_location = "data/blockrules/blockrules.xml",
  mostra_new = c(10, 43, 17, 15, 18, 16, 45, 44),
  mostra_old = c(10, 42, 41, 15, 16, 43),
  glue_string = "",
  optimize_feature_calculation = TRUE,
  alerts_new = NA,
  alerts_old = NA,
  ast_new = NA,
  ast_old = NA,
  diff = NA,
  only_categorised = FALSE
)

Arguments

code_file_new

file containing the source code of the new version. If this parameter is empty, the parameter code_new is used

code_file_old

file containing the source code of the old version. If this parameter is empty, the parameter code_old is used

code_new

source code of the new version. If this parameter is empty, the parameter code_file_new is used

code_old

source code of the old version. If this parameter is empty, the parameter code_file_old is used

pmd_path

complete path to pmd.bat including the name of the file

rule_path

path to the rules used for the PMD alerts

blockrules_location

path to the rules for the Abstract Syntax Tree

mostra_new

which nodes of the new version must appear?

mostra_old

which nodes of the old version must appear?

glue_string

template of a string that will be passed to str_glue and will be available in the returned info

optimize_feature_calculation

if true, the features are not calculated for all the combinations of new and old alerts if there is a perfect match

Value

a list with information about the comparison between old and new versions. The list contains the following items:


crotman/kludgenudger documentation built on Oct. 19, 2021, 7:30 p.m.