sqlccc 1.0.1__tar.gz → 1.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlccc-1.0.1 → sqlccc-1.1.1}/PKG-INFO +10 -2
- sqlccc-1.1.1/README.md +10 -0
- {sqlccc-1.0.1 → sqlccc-1.1.1}/pyproject.toml +1 -1
- {sqlccc-1.0.1 → sqlccc-1.1.1}/sqlcc.py +3 -2
- {sqlccc-1.0.1 → sqlccc-1.1.1}/sqlccc.egg-info/PKG-INFO +10 -2
- sqlccc-1.0.1/README.md +0 -2
- {sqlccc-1.0.1 → sqlccc-1.1.1}/LICENSE +0 -0
- {sqlccc-1.0.1 → sqlccc-1.1.1}/setup.cfg +0 -0
- {sqlccc-1.0.1 → sqlccc-1.1.1}/sqlccc.egg-info/SOURCES.txt +0 -0
- {sqlccc-1.0.1 → sqlccc-1.1.1}/sqlccc.egg-info/dependency_links.txt +0 -0
- {sqlccc-1.0.1 → sqlccc-1.1.1}/sqlccc.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlccc
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: A cyclomatix complexity calculator for SQL
|
|
5
5
|
Author-email: Søren Brønsted <soren@bronsted.dk>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -14,4 +14,12 @@ License-File: LICENSE
|
|
|
14
14
|
Dynamic: license-file
|
|
15
15
|
|
|
16
16
|
# sqlcc
|
|
17
|
-
|
|
17
|
+
A [cyclomatix complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
|
|
18
|
+
calculator for SQL
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sqlcc <file.sql>
|
|
24
|
+
```
|
|
25
|
+
which output a number representing the cyclomatic complexity of the SQL file.
|
sqlccc-1.1.1/README.md
ADDED
|
@@ -5,13 +5,14 @@ Calculate the cyclomatic complexity of a SQL query.
|
|
|
5
5
|
|
|
6
6
|
Args:
|
|
7
7
|
sql (str): The SQL query string.
|
|
8
|
+
dialect (str): The SQL dialect to use for parsing. See sqlglot documentation for supported dialects.
|
|
8
9
|
|
|
9
10
|
Returns:
|
|
10
11
|
int: The calculated cyclomatic complexity.
|
|
11
12
|
"""
|
|
12
|
-
def calc(sql: str) -> int:
|
|
13
|
+
def calc(sql: str, dialect='snowflake') -> int:
|
|
13
14
|
result = 1
|
|
14
|
-
parsed = sg.parse_one(sql)
|
|
15
|
+
parsed = sg.parse_one(sql,dialect=dialect)
|
|
15
16
|
cyclomatics = [
|
|
16
17
|
# Logic
|
|
17
18
|
sg.exp.And, sg.exp.Or, sg.exp.In, sg.exp.Between, sg.exp.Like, sg.exp.Group,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlccc
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: A cyclomatix complexity calculator for SQL
|
|
5
5
|
Author-email: Søren Brønsted <soren@bronsted.dk>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -14,4 +14,12 @@ License-File: LICENSE
|
|
|
14
14
|
Dynamic: license-file
|
|
15
15
|
|
|
16
16
|
# sqlcc
|
|
17
|
-
|
|
17
|
+
A [cyclomatix complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
|
|
18
|
+
calculator for SQL
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sqlcc <file.sql>
|
|
24
|
+
```
|
|
25
|
+
which output a number representing the cyclomatic complexity of the SQL file.
|
sqlccc-1.0.1/README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|