@@ -66,7 +66,7 @@ class ImportKey(Enum):
6666 ALIAS = 4
6767
6868
69- def sort_code_string (
69+ def sort_code_string ( # noqa: PLR0913
7070 code : str ,
7171 extension : Optional [str ] = None ,
7272 config : Config = DEFAULT_CONFIG ,
@@ -85,6 +85,12 @@ def sort_code_string(
8585 - **show_diff**: If `True` the changes that need to be done will be printed to stdout, if a
8686 TextIO stream is provided results will be written to it, otherwise no diff will be computed.
8787 - ****config_kwargs**: Any config modifications.
88+
89+ Future modifications should consider refactoring to reduce complexity.
90+
91+ * There are currently 6 function argurments vs 5 recommended.
92+
93+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
8894 """
8995 input_stream = StringIO (code )
9096 output_stream = StringIO ()
@@ -102,7 +108,7 @@ def sort_code_string(
102108 return output_stream .read ()
103109
104110
105- def check_code_string (
111+ def check_code_string ( # noqa: PLR0913
106112 code : str ,
107113 show_diff : Union [bool , TextIO ] = False ,
108114 extension : Optional [str ] = None ,
@@ -122,6 +128,12 @@ def check_code_string(
122128 - **file_path**: The disk location where the code string was pulled from.
123129 - **disregard_skip**: set to `True` if you want to ignore a skip set in config for this file.
124130 - ****config_kwargs**: Any config modifications.
131+
132+ Future modifications should consider refactoring to reduce complexity.
133+
134+ * There are currently 6 function argurments vs 5 recommended.
135+
136+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
125137 """
126138 config = _config (path = file_path , config = config , ** config_kwargs )
127139 return check_stream (
@@ -134,7 +146,7 @@ def check_code_string(
134146 )
135147
136148
137- def sort_stream (
149+ def sort_stream ( # noqa: C901,PLR0913,PLR0912
138150 input_stream : TextIO ,
139151 output_stream : TextIO ,
140152 extension : Optional [str ] = None ,
@@ -157,6 +169,14 @@ def sort_stream(
157169 - **show_diff**: If `True` the changes that need to be done will be printed to stdout, if a
158170 TextIO stream is provided results will be written to it, otherwise no diff will be computed.
159171 - ****config_kwargs**: Any config modifications.
172+
173+ Future modifications should consider refactoring to reduce complexity.
174+
175+ * The McCabe cyclomatic complexity is currently 14 vs 10 recommended.
176+ * There are currently 8 function argurments vs 5 recommended.
177+ * There are currently 13 branches vs 12 recommended.
178+
179+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
160180 """
161181 extension = extension or (file_path and file_path .suffix .lstrip ("." )) or "py"
162182 if show_diff :
@@ -237,7 +257,7 @@ def sort_stream(
237257 return changed
238258
239259
240- def check_stream (
260+ def check_stream ( # noqa: PLR0913
241261 input_stream : TextIO ,
242262 show_diff : Union [bool , TextIO ] = False ,
243263 extension : Optional [str ] = None ,
@@ -257,6 +277,12 @@ def check_stream(
257277 - **file_path**: The disk location where the code string was pulled from.
258278 - **disregard_skip**: set to `True` if you want to ignore a skip set in config for this file.
259279 - ****config_kwargs**: Any config modifications.
280+
281+ Future modifications should consider refactoring to reduce complexity.
282+
283+ * There are currently 6 function argurments vs 5 recommended.
284+
285+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
260286 """
261287 config = _config (path = file_path , config = config , ** config_kwargs )
262288
@@ -304,7 +330,7 @@ def check_stream(
304330 return False
305331
306332
307- def check_file (
333+ def check_file ( # noqa: PLR0913
308334 filename : Union [str , Path ],
309335 show_diff : Union [bool , TextIO ] = False ,
310336 config : Config = DEFAULT_CONFIG ,
@@ -324,6 +350,12 @@ def check_file(
324350 - **disregard_skip**: set to `True` if you want to ignore a skip set in config for this file.
325351 - **extension**: The file extension that contains imports. Defaults to filename extension or py.
326352 - ****config_kwargs**: Any config modifications.
353+
354+ Future modifications should consider refactoring to reduce complexity.
355+
356+ * There are currently 6 function argurments vs 5 recommended.
357+
358+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
327359 """
328360 file_config : Config = config
329361
@@ -368,7 +400,7 @@ def _file_output_stream_context(filename: Union[str, Path], source_file: File) -
368400# Ignore DeepSource cyclomatic complexity check for this function. It is one
369401# the main entrypoints so sort of expected to be complex.
370402# skipcq: PY-R1000
371- def sort_file (
403+ def sort_file ( # noqa: C901,PLR0913,PLR0912,PLR0915
372404 filename : Union [str , Path ],
373405 extension : Optional [str ] = None ,
374406 config : Config = DEFAULT_CONFIG ,
@@ -395,6 +427,15 @@ def sort_file(
395427 - **output**: If a TextIO is provided, results will be written there rather than replacing
396428 the original file content.
397429 - ****config_kwargs**: Any config modifications.
430+
431+ Future modifications should consider refactoring to reduce complexity.
432+
433+ * The McCabe cyclomatic complexity is currently 18 vs 10 recommended.
434+ * There are currently 9 function argurments vs 5 recommended.
435+ * There are currently 21 branches vs 12 recommended.
436+ * There are currently 59 statements vs 50 recommended.
437+
438+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
398439 """
399440 file_config : Config = config
400441
0 commit comments