Classifier
apiRequest(url, token)
apiRequest To make api requests to the GitHub API
@url - the url for the API @token - GitHub API token
Source code in src/core/classifier.py
classify_hunk(class_patch, class_buggy)
classify_hunk To classify a hunk
@class_patch @class_buggy
Source code in src/core/classifier.py
classify_patch(hunk_classifications)
classify_patch To classify a patch based on the hunks
@hunk_classifications - the classifications for the different hunks in the .diff of a file changed in a PR
Source code in src/core/classifier.py
find_hunk_matches(match_items, _type, important_hashes, source_hashes)
find_hunk_matches To find the different matches between two hunk using the hashed values
@match_items @_type @important_hashes @source_hashes
Source code in src/core/classifier.py
find_hunk_matches_w_important_hash(match_items, _type, important_hashes, source_hashes)
find_hunk_matches_w_important_hash To find the different matches between two hunk using the hashed values and using the important hash feature
@match_items @_type @important_hashes @source_hashes
Source code in src/core/classifier.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
getFileBeforePatch(repo_dir, mainline, sha, parent, pair_nr, pr_nr, file, fileDir, fileName, token)
getFileBeforePatch Extracts the buggy file using the GitHub API
@repo_dir - directory where to store the file @mainline - the source repository @sha - the commit sha-value that last changed the file @parent - the parent commit sha-value of the commit that last changed the file @pr_nr - the pull request number of the patch @file - the file path in the repository @fileDir - the sub directory where to store the file @fileName - a name to store the file @token - token needed for the GitHub API
Source code in src/core/classifier.py
getFirstLastCommit(pr_commits)
getFirstLastCommit Retrieve the first and the last commit of a pull request
@pr_commits
Source code in src/core/classifier.py
get_ext(file)
get_ext Extract the extension of the a file
@file - the file from which to extract the file
processPatch(patchPath, dstPath, typePatch)
processPatch To process a patch This is done before bein able to classify the patch
@patchPath - the path where the patch file is stored @dstPath - the path where the destination file is stored @typePatch - the kind of patch we are dealing with, buggy or fixed
Source code in src/core/classifier.py
save_patch(storageDir, fileName, file, dup_count)
save_patch To save a patch file
@storageDir - The directory where to save the patch @fileName - The name of the file @file - The content of the file
Source code in src/core/classifier.py
unified_diff(before, after)
unified_diff To create a unified diff file
@before - The state of the file before changes @after - The state of the file after the changes