Function build_readme_from_integration
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def build_readme_from_integration(integration, mode=''):
# COLLECTORS
if mode == 'collector':
try:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File gen_docs_integrations.py
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import re
import shutil
from pathlib import Path
Function write_to_file
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def write_to_file(path, md, meta_yaml, sidebar_label, community, mode='default'):
"""
takes the arguments needed to write the integration markdown to the proper file.
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function cleanup
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def cleanup():
"""
clean directories that are either data collection or exporting integrations
"""
for element in Path("src/go/plugin/go.d/modules").glob('**/*/'):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generate_category_from_name
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def generate_category_from_name(category_fragment, category_array):
"""
Takes a category ID in splitted form ("." as delimiter) and the array of the categories, and returns the proper category name that Learn expects.
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function write_to_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_to_file(path, md, meta_yaml, sidebar_label, community, mode='default'):