Code forensics
0.1
Generate historical information about code changes
|
Headers for the repository processing algorithms. More...
#include <mutex>
#include <boost/process.hpp>
#include "common.hpp"
#include "git_ir.hpp"
#include "program_state.hpp"
Go to the source code of this file.
Classes | |
struct | SubTaskParams |
Typedefs | |
using | SLock = std::scoped_lock< std::mutex > |
Functions | |
auto | get_nesting (CR< Str > line) -> int |
void | push_line (ir::FileId id, walker_state *walker, CR< ir::LineData > line, bool changed, int period) |
ir::FileId | stats_via_subprocess (git_oid commit_oid, walker_state *walker, ir::File file, CR< Str > relpath) |
ir::FileId | stats_via_libgit (walker_state *state, git_oid commit_oid, const git_tree_entry *entry, CR< Str > relpath, ir::File file) |
ir::FileId | exec_walker (git_oid commit_oid, walker_state *state, ir::CommitId commit, const char *root, const git_tree_entry *entry) |
ir::CommitId | process_commit (git_oid commit_oid, walker_state *state) |
void | file_tasks (Vec< SubTaskParams > &treewalk, walker_state *state, git_oid commit_oid, ir::CommitId out_commit) |
void | open_walker (git_oid &oid, walker_state &state) |
Vec< ir::CommitId > | launch_analysis (git_oid &oid, walker_state *state) |
Headers for the repository processing algorithms.
using SLock = std::scoped_lock<std::mutex> |
ir::FileId exec_walker | ( | git_oid | commit_oid, |
walker_state * | state, | ||
ir::CommitId | commit, | ||
const char * | root, | ||
const git_tree_entry * | entry | ||
) |
void file_tasks | ( | Vec< SubTaskParams > & | treewalk, |
walker_state * | state, | ||
git_oid | commit_oid, | ||
ir::CommitId | out_commit | ||
) |
state | List of subtasks that need to be executed for each specific file. |
auto get_nesting | ( | CR< Str > | line | ) | -> int |
Vec<ir::CommitId> launch_analysis | ( | git_oid & | oid, |
walker_state * | state | ||
) |
void open_walker | ( | git_oid & | oid, |
walker_state & | state | ||
) |
ir::CommitId process_commit | ( | git_oid | commit_oid, |
walker_state * | state | ||
) |
Implementaiton of the commit processing function. Walks files that were available in the repository at the time and process each file individually, filling data into the content store.
void push_line | ( | ir::FileId | id, |
walker_state * | walker, | ||
CR< ir::LineData > | line, | ||
bool | changed, | ||
int | period | ||
) |
Append new line to the file and update related counteres (total complexity, line count and so on)
ir::FileId stats_via_libgit | ( | walker_state * | state, |
git_oid | commit_oid, | ||
const git_tree_entry * | entry, | ||
CR< Str > | relpath, | ||
ir::File | file | ||
) |
ir::FileId stats_via_subprocess | ( | git_oid | commit_oid, |
walker_state * | walker, | ||
ir::File | file, | ||
CR< Str > | relpath | ||
) |
Start git blame subprocess
Read it's standard output
Proces is started in the specified project directory
For now we are only looking into the authoring time