🧰🔧🔨 codexplor
is a WIP 🧰🔧🔨
codexplor
offers R functions dedicated to explore, analyze and
monitor a programming project.
Given a programming project, codexplor
compute standardized text
mining metrics and dataviz’ about the project.
- Get rid of global complexity with networks of internal dependencies,
- Assess local complexity with
- document-level (e.g., identify files with many functions defined in)
- and function-level metrics (e.g., longest functions, those with numerous parameters or internal dependencies).
codexplor
help me to figure out the big picture of a programming project faster, and to manage it more efficiently.
You can install the development version of codexplor with
devtools::install_github("clement-LVD/codexplor")
The default settings of codexplor
are optimized for analyzing a
project in language.
Supported languages are : R, Python
1. Turn a programming project into a corpus. Given folder(s) and/or
github repo(s) and programming language(s),
codexplor::construct_corpus
will return a list
of dataframes : the
programming project is turned into a text-mining corpus.
library(codexplor)
# Construct a corpus with local folder
corpus <- construct_corpus(folders = getwd(), languages = "R" )
This corpus of dataframes is a standardized way to analyze a programming
project as a collection of documents and get insights on the functions
and the files of the project, see the vignette of
construct_corpus()
.
2. See a dataviz’ from a corpus.list. Given a corpus.list
, look at
the dataviz’ of an internal.dependencies
network with
codexplor::get_networkd3_from_igraph
:
# Produce an interactive dataviz' with the network of internal.dependencies
dataviz <- get_networkd3_from_igraph(corpus$functions.network
, title_h1 = "codexplor. Graph of internal dependancies : functions network"
, subtitle_h2 = "Color and links = indegrees")
# herafter an image (non-interactive) of the interactive dataviz ↓
These dataviz are useful for pinpointing where to start a polishing loop, identifying all the functions impacted by upcoming changes, […] or assessing the impact of a new dev loop on the project’s complexity.
Or look for a dataviz of the files with the following :
get_networkd3_from_igraph(corpus$files.network)
See an example of a files network.
-
See the vignette of
construct_corpus()
. -
See the vignette of the
citations.network
ofinternal.dependencies
dataframes. -
codexplor
also offers helper functions, e.g., for create and filter a network with theigraph
package, see the vignette of helper functions for igraph object and networkD3 dataviz
Given programming project(s), codexplor::construct_corpus
will compute
several standardized metrics and answer a corpus.list
of dataframes :
-
The
functions
data.frame
give insights about each functions of the project(s), e.g., number of parameters, number of internal dependencies, length of the code. -
The
files
data.frame
give insights about each files, e.g., quantify number of functions within files and assess critical internal dependencies. -
The
files.network
andfunctions.network
are networks of internal dependencies within the project(s).