Skip to content

Commit

Permalink
feat(docs): #2 update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rohaquinlop committed Feb 10, 2024
1 parent 98214ee commit 7ab2bc4
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,27 @@
An extremely fast Python library to calculate the cognitive complexity of
python files, written in Rust.

## Installation
## Getting Started

```bash
pip install complexipy
```
### Installation

## Usage

To calculate the cognitive complexity of a single file, you can use the
following command:
**complexipy** is available as
[`complexipy`](https://pypi.org/project/complexipy/) on PyPI (Python >= 3.11):

```bash
complexipy path/to/file.py
pip install complexipy
```

To calculate the cognitive complexity of a directory, you can use the following
command:
### Usage

```bash
complexipy path/to/directory
```

by default the maximum cognitive complexity is 15, you can change it using the
`-m` option, for example:
To run **complexipy** you can use the following command:

```bash
complexipy path/to/directory -m 20
```
<pre lang="shell">
<b>complexipy</b> . # Use complexipy to analyze the current directory and any subdirectories with python files
<b>complexipy</b> path/to/directory # Use complexipy to analyze a specific directory and any subdirectories with python files
<b>complexipy</b> path/to/file.py # Use complexipy to analyze a specific file
<b>complexipy</b> path/to/file.py -m 20 # Use the -m option to set the maximum congnitive complexity, default is 15
</pre>

For example, given the following file:

Expand All @@ -52,7 +45,7 @@ The cognitive complexity of the file is 3, and the output of the command
`complexipy path/to/file.py` will be:

```bash
───────────────────────────── complexipy 0.1.0 🐙 ──────────────────────────────
───────────────── complexipy 0.1.0 🐙 ─────────────────
test_decorator.py
Analysis completed! 🎉
Summary
Expand Down

0 comments on commit 7ab2bc4

Please sign in to comment.