@@ -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 :
@@ -235,7 +255,7 @@ def sort_stream(
235255 return changed
236256
237257
238- def check_stream (
258+ def check_stream ( # noqa: PLR0913
239259 input_stream : TextIO ,
240260 show_diff : Union [bool , TextIO ] = False ,
241261 extension : Optional [str ] = None ,
@@ -255,6 +275,12 @@ def check_stream(
255275 - **file_path**: The disk location where the code string was pulled from.
256276 - **disregard_skip**: set to `True` if you want to ignore a skip set in config for this file.
257277 - ****config_kwargs**: Any config modifications.
278+
279+ Future modifications should consider refactoring to reduce complexity.
280+
281+ * There are currently 6 function argurments vs 5 recommended.
282+
283+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
258284 """
259285 config = _config (path = file_path , config = config , ** config_kwargs )
260286
@@ -302,7 +328,7 @@ def check_stream(
302328 return False
303329
304330
305- def check_file (
331+ def check_file ( # noqa: PLR0913
306332 filename : Union [str , Path ],
307333 show_diff : Union [bool , TextIO ] = False ,
308334 config : Config = DEFAULT_CONFIG ,
@@ -322,6 +348,12 @@ def check_file(
322348 - **disregard_skip**: set to `True` if you want to ignore a skip set in config for this file.
323349 - **extension**: The file extension that contains imports. Defaults to filename extension or py.
324350 - ****config_kwargs**: Any config modifications.
351+
352+ Future modifications should consider refactoring to reduce complexity.
353+
354+ * There are currently 6 function argurments vs 5 recommended.
355+
356+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
325357 """
326358 file_config : Config = config
327359
@@ -366,7 +398,7 @@ def _file_output_stream_context(filename: Union[str, Path], source_file: File) -
366398# Ignore DeepSource cyclomatic complexity check for this function. It is one
367399# the main entrypoints so sort of expected to be complex.
368400# skipcq: PY-R1000
369- def sort_file (
401+ def sort_file ( # noqa: C901,PLR0913,PLR0912,PLR0915
370402 filename : Union [str , Path ],
371403 extension : Optional [str ] = None ,
372404 config : Config = DEFAULT_CONFIG ,
@@ -393,6 +425,15 @@ def sort_file(
393425 - **output**: If a TextIO is provided, results will be written there rather than replacing
394426 the original file content.
395427 - ****config_kwargs**: Any config modifications.
428+
429+ Future modifications should consider refactoring to reduce complexity.
430+
431+ * The McCabe cyclomatic complexity is currently 18 vs 10 recommended.
432+ * There are currently 9 function argurments vs 5 recommended.
433+ * There are currently 21 branches vs 12 recommended.
434+ * There are currently 59 statements vs 50 recommended.
435+
436+ To revalidate these numbers, run `ruff check --select=C901,PLR091`.
396437 """
397438 file_config : Config = config
398439
0 commit comments