---
# System prepended metadata

title: Development Tools
tags: [wp2, ' slides']

---

---
title: Development Tools
tags: wp2, slides
type: slide
---

# Development Tools

---

## Goals

- Reduce the effort for developers
- Increase software security, detecting more vulnerabilities
- Maintain a software in an easier way

---

## Tools

- sifis-generate
- complex-code-spotter
- weighted-code-coverage

---

## Why Rust?

- Memory safety without the need of a garbage collection
- Possibility to optimise software both in time and memory
- Writing parallel code in an easier way
- Package and deploy software in a few steps
- Support the most known platforms, such as Linux, macOS and Windows and bare-metal targets

---

# sifis-generate

---

## sifis-generate

- Reduce the conceptual effort requested by developers to set up a CI pipeline
- New project from scratch or series of CI configuration files to an existing project
- Different languages (C/C++, Python, Java, JavaScript, Rust) 
- Usage of templates to produce scripts and files

---

## sifis-generate

<style>
img[alt~="center"] {
  display: block;
  margin: 0 auto;
}
</style>

![center](/home/mik/Desktop/wp2-tools/sifis-generate-deps.png)

---

## sifis-generate

```
sifis-generate cargo [--license LICENSE --name NAME --branch GITHUB_BRANCH] project-path
```

---

## sifis-generate

- C/C++ -> Meson
- Python -> Poetry
- Java -> Maven
- Rust -> Cargo
- JavaScript -> Yarn

---

# complex-code-spotter

---

## complex-code-spotter

- Detect pieces of complex code through complexity metrics
- Use *rust-code-analysis*, a Mozilla tool, for metrics computation
- Possibility to set thread numbers and filter files according to their extension

---

## complex-code-spotter

<style>
img[alt~="center"] {
  display: block;
  margin: 0 auto;
}
</style>

![center](/home/mik/Desktop/wp2-tools/complex-code-spotter-deps.png)

---

## complex-code-spotter

*Simple usage*

```
complex-code-spotter -c cyclomatic:3 -c cognitive:16 /path/to/your/file/or/directory /output/path
```

---

## complex-code-spotter

*Consider only `*.rs` files*

```
complex-code-spotter -I "*.rs" /path/to/your/file/or/directory /output/path
```

*Exclude only `*.rs` files*

```
complex-code-spotter -X "*.rs" /path/to/your/file/or/directory /output/path
```

---

# weighted-code-coverage

---

## weighted-code-coverage

- Combination of code complexity and code coverage into four new metrics
- Two metrics have been created in the SIFIS-Home project: **wcc-plain** and **wcc-quantized**
- Use *rust-code-analysis* for code complexity computation
- Chunks, threads and granularity

---

## weighted-code-coverage

<style>
img[alt~="center"] {
  display: block;
  margin: 0 auto;
}
</style>

![center](/home/mik/Desktop/wp2-tools/weighted-code-coverage-deps.png)

---

## weighted-code-coverage

*Simple usage*

```
weighted-code-coverage [OPTIONS] --path_file <PATH_FILE> --path_json <PATH_JSON>
```

---

## weighted-code-coverage

*Select complexity metric*

```
weighted-code-coverage --path_file <PATH_FILE> --path_json <PATH_JSON> -c cognitive
```

*Choose the mode used for the analysis*

```
weighted-code-coverage --path_file <PATH_FILE> --path_json <PATH_JSON> -m functions
```

*Choose thresholds*

```
weighted-code-coverage --path_file <PATH_FILE> --path_json <PATH_JSON> -t 50.0,0.7,65.0,45.0
```

---

## Next tools releases?

### sifis-generate
- Fixed many issues related to the tools for dynamic analysis
- Refactored the code

### complex-code-spotter
- No issues found so far
   
### weighted-code-coverage
- Added HTML output

---

## Links

- [https://github.com/sifis-home/sifis-generate](https://github.com/sifis-home/sifis-generate)
- [https://github.com/sifis-home/complex-code-spotter](https://github.com/sifis-home/complex-code-spotter)
- [https://github.com/sifis-home/weighted-code-coverage](https://github.com/sifis-home/weighted-code-coverage)

---


# Any question?