Repository Analysis

plasma-umass/scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals

12.1 Low AI signal View on GitHub
12.1
Adjusted Score
12.1
Raw Score
100%
Time Factor
2026-05-16
Last Push
13,432
Stars
Python
Language
108,835
Lines of Code
427
Files
935
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 21MEDIUM 118LOW 795

Pattern Findings

935 matches across 17 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers410 hits · 398 pts
SeverityFileLineSnippet
LOWsetup.py186def fetch_vendor_deps_windows():
LOWsetup.py303 def _fix_windows_arch_mismatch(self):
LOWsetup.py429 def copy_extensions_to_source(self):
LOWtest/test_sparkline.py19def test_get_bars__in_wsl_and_windows_terminal(monkeypatch):
LOWtest/test_sparkline.py35def test_generate__up_and_down():
LOWtest/test_sparkline.py43def test_generate__all_zeroes():
LOWtest/test_sparkline.py51def test_generate__with_negative_values():
LOWtest/test_sparkline.py67def test_generate__with_max_same_as_actual_max():
LOWtest/test_sparkline.py75def test_generate__with_max_below_actual_max():
LOWtest/test_tracer.py117 def test_sys_monitoring_default(self):
LOWtest/test_tracer.py157 def test_using_sys_monitoring(self):
LOWtest/test_tracer.py166 def test_set_use_legacy_tracer(self):
LOWtest/test_tracer.py187 def test_pywhere_sysmon_available(self):
LOWtest/test_tracer.py240 def test_function_call_attribution(self):
LOWtest/issues/test-issue167.py18def get_mean_for_indicator_poor(df, indicator):
LOWtest/issues/test-issue167.py28def get_mean_for_indicator_better(df, indicator, rnd_cols):
LOWtests/test_memory_multithreaded_gil_release.py48def test_worker_alloc_outweighs_main_sleep(tmp_path: Path) -> None:
LOWtests/test_memory_multithreaded_gil_release.py84def test_memory_stacks_leaf_is_worker(tmp_path: Path) -> None:
LOWtests/test_cpu_attribution.py236 def test_c_time_attributed_to_call_line(self, profiler, stats):
LOWtests/test_cpu_attribution.py275 def test_pure_python_no_preceding_call(self, profiler, stats):
LOWtests/test_cpu_attribution.py306 def test_multi_consecutive_c_calls(self, profiler, stats):
LOWtests/test_cpu_attribution.py359 def test_thread_at_call_instruction_attributes_to_c(self, profiler, stats):
LOWtests/test_cpu_attribution.py422 def test_at_call_instruction_attributes_to_c(
LOWtests/test_cpu_attribution.py461 def test_not_at_call_attributes_to_python(
LOWtests/test_cpu_attribution.py556 def test_first_body_line_detected(self) -> None:
LOWtests/test_cpu_attribution.py578 def test_non_loop_line_returns_none(self) -> None:
LOWtests/test_cpu_attribution.py589 def test_mid_body_line_returns_none(self) -> None:
LOWtests/test_cpu_attribution.py604 def test_loop_with_calls_returns_none(self) -> None:
LOWtests/test_cpu_attribution.py624 def test_nested_loop_picks_innermost(self) -> None:
LOWtests/test_cpu_attribution.py651 def test_loop_body_time_redistributed(self, profiler: ScaleneCPUProfiler, stats: ScaleneStatistics) -> None:
LOWtests/test_cpu_attribution.py702 def test_no_loop_redistribution_mid_body(self, profiler: ScaleneCPUProfiler, stats: ScaleneStatistics) -> None:
LOWtests/test_coverup_98.py26def test_remove_nonexistent_child_pid():
LOWtests/test_line_attribution_nested.py99def test_mallocs_credited_to_allocator_not_caller(tmp_path: Path) -> None:
LOWtests/test_line_attribution_nested.py140def test_memory_samples_timeline_only_on_allocator(tmp_path: Path) -> None:
LOWtests/test_line_attribution_nested.py172def test_memory_stacks_leaf_is_allocator(tmp_path: Path) -> None:
LOWtests/test_coverup_121.py17def test_launch_browser_insecure_on_mac(mock_platform_system):
LOWtests/test_coverup_121.py31def test_launch_browser_insecure_on_windows(mock_platform_system):
LOWtests/test_sysmon_tool_id_conflict.py22 def test_fallback_when_profiler_id_taken(self):
LOWtests/test_sysmon_tool_id_conflict.py51 def test_fallback_to_legacy_when_all_ids_taken(self):
LOWtests/test_sysmon_tool_id_conflict.py89 def test_profiling_works_with_id_conflict(self):
LOWtests/test_sysmon_tool_id_conflict.py210 def test_scalene_with_torch_profiler(self):
LOWtests/test_memory_multithreaded_stacks.py49def test_memory_stacks_cover_both_workers(tmp_path: Path) -> None:
LOWtests/test_memory_multithreaded_stacks.py78def test_memory_stacks_leaves_are_fixture(tmp_path: Path) -> None:
LOWtests/test_coverup_131.py18def test_profile_this_code_without_files_to_profile(scalene_cleanup):
LOWtests/test_coverup_125.py13def scalene_setup_and_teardown():
LOWtests/test_coverup_125.py38def test_start_signal_handler(scalene_setup_and_teardown):
LOWtests/test_jax_profiler.py41 def test_jax_profiler_is_available_matches_import(self):
LOWtests/test_jax_profiler.py51 def test_jax_profiler_get_line_time_default(self):
LOWtests/test_jax_profiler.py57 def test_jax_profiler_get_gpu_line_time_default(self):
LOWtests/test_jax_profiler.py93 def test_jax_profiler_line_time_conversion(self):
LOWtests/test_jax_profiler.py103 def test_jax_profiler_gpu_line_time_conversion(self):
LOWtests/test_jax_profiler.py113 def test_jax_profiler_get_all_times(self):
LOWtests/test_jax_profiler.py26 def test_jax_profiler_extends_base_class(self):
LOWtests/test_jax_profiler.py78 def test_jax_profiler_has_gpu_timing(self):
LOWtests/test_jax_profiler.py145 def test_start_without_jax_is_noop(self):
LOWtests/test_jax_profiler.py154 def test_stop_without_start_is_safe(self):
LOWtests/test_jax_profiler.py166 def test_jax_profiler_start_stop(self):
LOWtests/test_jax_profiler.py187 def test_jax_profiler_captures_operations(self):
LOWtests/test_jax_profiler.py216 def test_jax_profiler_trace_dir_cleanup(self):
LOWtests/test_jax_profiler.py237 def test_jax_profiler_multiple_start_stop(self):
350 more matches not shown…
Decorative Section Separators59 hits · 209 pts
SeverityFileLineSnippet
MEDIUMtest/test_freethreaded_parity.py23# ── Workload scripts ────────────────────────────────────────────────
MEDIUMtest/test_freethreaded_parity.py156# ── Helpers ─────────────────────────────────────────────────────────
MEDIUMtest/test_freethreaded_parity.py269# ── Test phases ─────────────────────────────────────────────────────
MEDIUMtest/test_freethreaded_parity.py581# ── Main ────────────────────────────────────────────────────────────
MEDIUM…t/expensive_benchmarks/docutils_data/docs/dev/todo.txt807 # =================
MEDIUMtests/test_cpu_attribution.py30# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py33# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py154# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py156# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py174# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py176# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py218# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py220# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py397# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py399# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py500# ---------------------------------------------------------------------------
MEDIUMtests/test_cpu_attribution.py502# ---------------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py15 # ------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py17 # ------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py41 # ------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py43 # ------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py64 # ------------------------------------------------------------------
MEDIUMtests/test_nested_package_relative_import.py66 # ------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py53# ---------------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py55# ---------------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py128# ---------------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py130# ---------------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py153# ---------------------------------------------------------------------------
MEDIUMtests/test_child_cmdline.py157# ---------------------------------------------------------------------------
MEDIUMtests/test_issue999_wallclock.py26# ---------------------------------------------------------------------------
MEDIUMtests/test_issue999_wallclock.py28# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py155# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py157# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py186# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py188# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py870# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py872# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py1212# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py1214# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py1511# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py1513# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py59# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py61# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py694# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py696# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py292# ---------------------------------------------------------------------------
MEDIUMtests/test_native_stacks.py294# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py93# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py95# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py320# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py322# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py344# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py346# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py400# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py402# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py30# ---------------------------------------------------------------------------
MEDIUMtests/test_on_off_windows.py32# ---------------------------------------------------------------------------
MEDIUMscalene/scalene_apple_gpu.py7# ---------------------------------------------------------------------------
MEDIUMscalene/scalene_apple_gpu.py9# ---------------------------------------------------------------------------
Unused Imports161 hits · 152 pts
SeverityFileLineSnippet
LOWtest/test-size.py1
LOWtest/test_sparkline.py1
LOWtest/multiprocessing_test.py1
LOWtest/multiprocessing_test.py3
LOWtest/smoketest_issue_1022.py39
LOWtest/profile_annotation_test.py14
LOWtest/profile_annotation_test.py80
LOWtest/small_mp_test.py2
LOWtest/small_mp_test.py3
LOWtest/small_mp_test.py4
LOWtest/threads-test.py2
LOWtest/testflask-driver.py1
LOWtest/testflask-driver.py2
LOWtest/pool-test.py1
LOWtest/new_mp_test.py2
LOWtest/testme.py2
LOWtest/test-martinheinz.py1
LOWtest/original/bm_richards.py12
LOWtest/automatic/dataframe/dataframe-select-optimized.py3
LOWtest/automatic/dataframe/dataframe-select-original.py3
LOWtest/optimized/bm_richards.py12
LOWtest/expensive_benchmarks/bm_async_tree_io.py24
LOWtest/expensive_benchmarks/bm_docutils.py6
LOWtest/expensive_benchmarks/bm_docutils.py10
LOWtest/expensive_benchmarks/bm_docutils.py12
LOWtest/expensive_benchmarks/bm_fannukh.py9
LOWtest/issues/test-issue167.py1
LOWtest/issues/test-issue379.py1
LOWtest/issues/test-issue130.py1
LOWtest/issues/test-issue266.py1
LOWtest/issues/test-issue266.py3
LOWtests/test_memory_multithreaded_gil_release.py22
LOWtests/test_coverup_110.py5
LOWtests/test_coverup_98.py5
LOWtests/test_line_attribution_nested.py17
LOWtests/test_coverup_115.py7
LOWtests/test_coverup_115.py7
LOWtests/test_coverup_121.py6
LOWtests/test_sysmon_tool_id_conflict.py135
LOWtests/test_sysmon_tool_id_conflict.py221
LOWtests/test_memory_multithreaded_stacks.py18
LOWtests/test_coverup_89.py7
LOWtests/test_coverup_65.py5
LOWtests/test_coverup_34.py5
LOWtests/test_coverup_24.py5
LOWtests/test_coverup_24.py7
LOWtests/test_coverup_30.py7
LOWtests/test_coverup_55.py7
LOWtests/test_coverup_45.py5
LOWtests/test_coverup_71.py7
LOWtests/test_coverup_71.py9
LOWtests/test_memory_arithmetic_smear.py23
LOWtests/test_memory_two_allocators.py15
LOWtests/test_coverup_54.py5
LOWtests/test_coverup_54.py6
LOWtests/test_coverup_54.py7
LOWtests/test_coverup_54.py8
LOWtests/test_coverup_15.py6
LOWtests/test_coverup_15.py9
LOWtests/test_coverup_83.py8
101 more matches not shown…
Self-Referential Comments46 hits · 142 pts
SeverityFileLineSnippet
MEDIUMtests/test_sysmon_tool_id_conflict.py139 # Create a test script that uses PyTorch
MEDIUMtests/test_sysmon_tool_id_conflict.py225 # Create a test script that uses torch.profiler
MEDIUMtests/test_coverup_125.py19 # Create a child process and add its PID to the set
MEDIUMtests/test_jax_profiler.py402 # Create a realistic trace file with multiple events
MEDIUMtests/test_jax_profiler.py527 # Create a temporary trace file
MEDIUMtests/test_tensorflow_profiler.py492 # Create a realistic trace file with multiple events
MEDIUMtests/test_coverup_24.py14# Create a test function to execute the missing lines/branches
MEDIUMtests/test_coverup_75.py28 # Create a temporary file to ensure the test environment is clean
MEDIUMtests/test_coverup_30.py28 # Create a ScaleneArguments object with default arguments
MEDIUMtests/test_coverup_20.py34 # Create a dummy profile file
MEDIUMtests/test_coverup_20.py48 # Create a dummy profile file
MEDIUMtests/test_coverup_15.py16 # Create a temporary directory for the test
MEDIUMtests/test_coverup_53.py13# Define a fixture to clean up state after each test
MEDIUMtests/test_coverup_53.py38 # Create a Namespace object with the necessary attributes
MEDIUMtests/test_coverup_118.py36 frame = MagicMock() # Create a MagicMock frame to simulate the behavior
MEDIUMtests/test_coverup_84.py18 # Create a temporary file to simulate the malloc lock file
MEDIUMtests/test_torch_profiler.py132 # Define a JIT function in this file so we know the filename
MEDIUMtests/test_torch_profiler.py338 # Create a test script that uses JIT - must run long enough to profile
MEDIUMtests/test_perthread_stack_stitching.py424 # Create a minimal test script that runs worker threads
MEDIUMtests/test_coverup_109.py15# Define a simple HTTP server for testing purposes
MEDIUMtests/test_coverup_109.py44 # Create a temporary HTML file
MEDIUMtests/test_coverup_109.py45 temp_dir = tempfile.mkdtemp() # Create a new temporary directory
MEDIUMtests/test_coverup_91.py11 # Create a mock function to be decorated
MEDIUMtests/test_coverup_17.py19 # Define a process function that will be called by the queue
MEDIUMtests/test_coverup_17.py27 # Create an instance of ScaleneSigQueue
MEDIUMtests/test_coverup_139.py22 # Create a fake frame object using MagicMock
MEDIUMtests/test_coverup_116.py20 # Create a temporary profile file with some content
MEDIUMtests/test_coverup_122.py12# Define a test function to improve coverage
MEDIUMtests/test_coverup_122.py15 # Create a temporary file to simulate a Python script
MEDIUMtests/test_coverup_137.py29 # Define a dummy function to be decorated
MEDIUMtests/test_coverup_19.py15 # Create a temporary directory to simulate a native package with a .so file
MEDIUMtests/test_coverup_68.py18 # Define the source and destination dictionaries
MEDIUMtests/test_coverup_133.py10# Create a dummy function to profile
MEDIUMscalene/scalene_profiler.py403 # Create a temporary directory to hold aliases to the Python
MEDIUMscalene/scalene_utility.py823 # Create a new error with just the custom message
MEDIUMscalene/scalene_magics.py40 # Create a file to hold the supplied code.
MEDIUMscalene/launchbrowser.py26 # Create a temporary directory
MEDIUMscalene/launchbrowser.py28 # Create a command with the required flags
MEDIUMscalene/scalene_tensorflow.py114 # Create a temporary directory for traces
MEDIUMscalene/scalene_signals.py1# Import the necessary libraries.
MEDIUMscalene/scalene_statistics.py569 # Create a temporary instance to inspect attributes
MEDIUMscalene/scalene_statistics.py705 # Initialize statistics classes
MEDIUMscalene/scalene_statistics.py871 # Create a file in the Python alias directory with the relevant info.
MEDIUMscalene/scalene_jax.py65 # Create a temporary directory for traces
MEDIUMscalene/scalene_windows.py151 # Create a C callback wrapper
MEDIUMscalene/scalene_analysis.py33 # This module is not installed or something else went wrong; fail gracefully.
Cross-Language Confusion14 hits · 92 pts
SeverityFileLineSnippet
HIGHsetup.py179 print("Please install Node.js and run 'npm install && npm run build' in scalene/scalene-gui/")
HIGHtests/test_runningstats.py22 rstats.push(value)
HIGHtests/test_coverup_41.py16 running_stats.push(1)
HIGHtests/test_coverup_41.py18 running_stats.push(2)
HIGHtests/test_coverup_4.py16 running_stats.push(10.0)
HIGHtests/test_coverup_4.py22 running_stats.push(20.0)
HIGHtests/test_coverup_4.py28 running_stats.push(5.0)
HIGHtests/test_coverup_40.py11 stats.push(10)
HIGHtests/test_coverup_40.py12 stats.push(20)
HIGHtests/test_coverup_40.py13 stats.push(5)
HIGHtests/test_coverup_39.py11 stats.push(1)
HIGHtests/test_coverup_39.py12 stats.push(2)
HIGHtests/test_coverup_39.py13 stats.push(3)
HIGHscalene/scalene_output.py364 file=null,
Redundant / Tautological Comments55 hits · 83 pts
SeverityFileLineSnippet
LOWsetup.py124 # Check if node_modules exists (dependencies installed)
LOWtest/smoketest.py62 # Check if the target path parts appear at the end of the profiled path
LOWtests/test_coverup_88.py22 # Check if __in_jupyter is now True
LOWtests/test_coverup_31.py15 # Set attributes to non-default values
LOWtests/test_coverup_31.py23 # Check if the attributes are reset to their default values
LOWtests/test_coverup_15.py31 # Check if the sys.executable has been changed
LOWtests/test_coverup_15.py33 # Check if the sys.path has been updated
LOWtests/test_coverup_15.py35 # Check if the PATH environment variable has been updated
LOWtests/test_coverup_15.py37 # Check if the files have been created
LOWtests/test_coverup_118.py39 frame.f_back = None # Set f_back to None to trigger the return in line 1171
LOWtests/test_coverup_77.py16 # Check if elapsed_time has been updated
LOWtests/test_coverup_77.py18 # Check if start_time has been reset to 0
LOWtests/test_torch_profiler.py368 # Check if profile was generated
LOWtests/test_torch_profiler.py376 # Check if we have files to analyze
LOWtests/test_perthread_stack_stitching.py416 # Check if native unwinding is available
LOWtests/test_coverup_109.py73 # Check if the current directory was restored
LOWtests/test_coverup_139.py26 # Check if the queue put method was called with the correct arguments
LOWtests/test_coverup_116.py31 # Check if the output file was created and has content
LOWtests/test_coverup_116.py37 # Check if the output file contains the profile content
LOWtests/test_coverup_106.py27 # Check if the signal.SIGVTALRM is in the returned tuple
LOWtests/test_coverup_106.py29 # Check if the returned tuple only contains timer signals
LOWtests/test_coverup_59.py27 # Check if decimation occurred
LOWtests/test_coverup_59.py31 # Check if the median was correctly calculated
LOWtests/test_coverup_59.py56 # Check if decimation occurred
LOWtests/test_coverup_59.py60 # Check if the median was correctly calculated
LOWtests/test_coverup_107.py24 # Check if Scalene is now initialized
LOWscalene/scalene_memory_profiler.py191 # Iterate through the array to compute the new current footprint
LOWscalene/scalene_profiler.py1132 # Check if it's time to print profiling info.
LOWscalene/scalene_utility.py244 # Set frame to None so we skip this frame entirely.
LOWscalene/scalene_parseargs.py266 # Check if --help-advanced is in the arguments
LOWscalene/scalene_parseargs.py810 # Check if we should print this line
LOWscalene/scalene_parseargs.py954 # Check if the profile file exists
LOWscalene/scalene_parseargs.py1159 # Check if user provided a .py file without a subcommand
LOWscalene/scalene_parseargs.py1168 # Check if any argument looks like a Python file or module
LOWscalene/scalene_tensorflow.py22# Check if TensorFlow is available at import time
LOWscalene/scalene_torch.py19# Check if PyTorch is available at import time
LOWscalene/scalene_tracing.py93 # Check if this function is specifically decorated for profiling
LOWscalene/scalene_tracing.py232 # Check if the file is in the same directory tree as the program being profiled.
LOWscalene/scalene_tracing.py236 # Check if file is in program's directory or a subdirectory
LOWscalene/scalene_json.py505 # Check if this line has PyTorch profiler timing (for JIT-compiled code)
LOWscalene/scalene_json.py668 # Check if the function at this line is a coroutine
LOWscalene/scalene_tracer.py21# Check if we're running Python 3.12+ where sys.monitoring is available
LOWscalene/scalene_tracer.py24# Check if we're running Python 3.12+ where the C API for sys.monitoring is available
LOWscalene/scalene_tracer.py230 # Check if we're still on the same line
LOWscalene/scalene_tracer.py236 # Check if the original line is still on the call stack.
LOWscalene/scalene_jax.py22# Check if JAX is available at import time
LOWscalene/set_nvidia_gpu_modes.py38 # Check if the script is running as root
LOWscalene/scalene_cpu_profiler.py436 # Check if the original caller is stuck inside a call
LOWscalene/merge_scalene_neuron_profiles.py41 # Check if source matches any of the files in scalene profile
LOWscalene/merge_scalene_neuron_profiles.py85 # Check if CPU sample overlaps with any interval (strict overlap)
LOWscalene/merge_scalene_neuron_profiles.py87 # Check if CPU sample falls within interval exactly
LOWscalene/merge_scalene_neuron_profiles.py278 # Check if this line has neuron events
LOWscalene/scalene_analysis.py62 # Check if the node represents an import statement
LOWscalene/scalene_analysis.py92 # Check if the node represents an import from statement
LOWscalene/scalene_nvidia_gpu.py57 # Check if each GPU has accounting mode set.
Over-Commented Block72 hits · 70 pts
SeverityFileLineSnippet
LOWmypy.ini21# It's useful to try this occasionally, and keep it clean; but when
LOWsetup.py521
LOW.readthedocs.yaml21 # builder: "dirhtml"
LOWtest/test_freethreaded_parity.py541 print(f"\n Memory scaling (8T / 1T): {ratio_8_to_1:.2f}x (nominal 8x)")
LOWtest/original/bm_pyflate.py361 base[symbol] += 1
LOWtest/optimized/bm_raytrace.py421# args.width, args.height,
LOW…e_benchmarks/docutils_data/docs/dev/enthought-plan.txt181Python doesn't have multi-line comments; only single-line. A similar
LOWtests/test_coverup_14.py21 assert len(signals) == len(set(signals))
LOWtests/test_coverup_17.py61 # Before each test
LOWtests/test_native_stacks.py441 async def main():
LOWscalene/scalene_memory_profiler.py281 #
LOWscalene/scalene_memory_profiler.py301 # next legitimate sparkline sample reflects the right
LOWscalene/replacement_asyncio.py21 # Nothing to do here - activation is handled by the profiler
LOWscalene/scalene_arguments.py121 whose dest async_profile defaults to True).
LOWscalene/scalene_profiler.py721 assert f
LOWscalene/scalene_profiler.py821 alloc_sigq,
LOWscalene/scalene_profiler.py901 signal_all_threads()
LOWscalene/scalene_profiler.py1901 # Handle direct invocation of a string by executing the string and returning.
LOWscalene/scalene_utility.py61except ImportError:
LOWscalene/scalene_utility.py661 recorded = False
LOWscalene/scalene_utility.py1001# --------------------------------------------------------------------------- #
LOWscalene/scalene_json.py161
LOWscalene/scalene_json.py401 # Stitched Python+native call stacks (emitted when --stacks is set).
LOWscalene/scalene_json.py801 # read ``native_stacks`` independently. See P6 in the
LOWscalene/scalene_json.py821 resolve = None
LOWscalene/scalene_json.py1001 # attributable to any source line, so surface them at the top level.
LOWscalene/scalene_json.py1141 # the on-wire [module, symbol, ip, offset] list at the output
LOWscalene/scalene_statistics.py661 # frame tuples (outermost-first). Native IPs are resolved (and
LOWscalene/scalene_statistics.py681
LOWscalene/scalene_cpu_profiler.py101 elapsed.wallclock = elapsed.user
LOWscalene/scalene_cpu_profiler.py221 # The interval-based formula gives us:
LOWscalene/scalene-gui/scalene-gui.ts1201// so frame widths are proportional to bytes attributed to that call path
LOWscalene/scalene-gui/scalene-gui.ts1381// - Top: time-axis ruler with labeled ticks at a "nice" interval
LOWscalene/scalene-gui/scalene-gui.ts1401const TIMELINE_BUCKETS = 600; // resolution along x (vertical pixel columns).
LOWscalene/scalene-gui/scalene-gui.ts1821// Format a time value in seconds for the axis ruler. Uses ms for values
LOWbenchmarks/new_benchmark.py1import json
LOWbenchmarks/new_benchmark.py21 # "run",
LOW.github/workflows/test-smoketests.yml61 # always-passing checks come last as smoke for the lifecycle bits.
LOWsrc/include/sampleheap.hpp1#pragma once
LOWsrc/include/sampleheap.hpp21#include <sys/types.h>
LOWsrc/include/samplefile_win.hpp1#pragma once
LOWsrc/include/common_win.hpp1#pragma once
LOWsrc/include/common_win.hpp21#else
LOWsrc/include/common_win.hpp41#endif
LOWsrc/include/traceconfig.hpp1#pragma once
LOWsrc/include/traceconfig.hpp81 // Return false if filename contains paths corresponding to the native
LOWsrc/include/traceconfig.hpp101 // parent directory that is not literally called "scalene".
LOWsrc/include/sampler.hpp1#pragma once
LOWsrc/include/sampler.hpp21
LOWsrc/include/sampleheap_win.hpp1#pragma once
LOWsrc/include/mallocrecursionguard.hpp1#pragma once
LOWsrc/include/sharded_size_map.hpp1#pragma once
LOWsrc/include/common.hpp1#pragma once
LOWsrc/include/common.hpp21#define ATTRIBUTE_ALIGNED(s) __attribute__((aligned(s)))
LOWsrc/include/samplefile.hpp1#pragma once
LOWsrc/include/samplefile.hpp81 __LINE__);
LOWsrc/include/pywhere.hpp1#ifndef __PYWHERE_H
LOWsrc/include/memcpysampler.hpp1#pragma once
LOWsrc/include/memcpysampler.hpp21#include <sys/types.h>
LOWsrc/include/scaleneheader.hpp1#ifndef SCALENE_HEADER_H
12 more matches not shown…
Excessive Try-Catch Wrapping52 hits · 57 pts
SeverityFileLineSnippet
LOWsetup.py425 except Exception as e:
LOWtests/test_sysmon_tool_id_conflict.py240except Exception as e:
LOWscalene/scalene_profiler.py364 except Exception as e:
LOWscalene/scalene_profiler.py1305 except Exception:
LOWscalene/scalene_profiler.py1366 except Exception:
LOWscalene/scalene_profiler.py1417 except Exception:
LOWscalene/scalene_profiler.py1530 except Exception as e:
LOWscalene/scalene_profiler.py1808 except Exception as e:
LOWscalene/scalene_profiler.py1885 except Exception:
LOWscalene/scalene_profiler.py1927 except Exception:
LOWscalene/scalene_profiler.py1956 except Exception as ex:
LOWscalene/scalene_profiler.py2069 except Exception as ex:
LOWscalene/scalene_profiler.py2088 except Exception:
LOWscalene/scalene_utility.py172 except Exception:
LOWscalene/scalene_utility.py315 except Exception:
LOWscalene/scalene_utility.py349 except Exception:
LOWscalene/scalene_utility.py370 except Exception:
LOWscalene/scalene_utility.py388 except Exception:
LOWscalene/scalene_utility.py403 except Exception:
LOWscalene/scalene_utility.py423 except Exception:
LOWscalene/scalene_utility.py436 except Exception:
LOWscalene/scalene_utility.py465 except Exception:
LOWscalene/scalene_parseargs.py971 except Exception as e:
LOWscalene/scalene_tensorflow.py145 except Exception:
LOWscalene/scalene_tensorflow.py164 except Exception:
LOWscalene/scalene_async.py314 except Exception:
LOWscalene/scalene_torch.py115 except Exception:
LOWscalene/scalene_torch.py150 except Exception:
LOWscalene/scalene_torch.py152 except Exception:
LOWscalene/scalene_torch.py169 except Exception:
LOWscalene/scalene_torch.py178 except Exception:
LOWscalene/scalene_torch.py219 except Exception:
LOWscalene/scalene_torch.py248 except Exception:
LOWscalene/scalene_tracing.py191 except Exception:
LOWscalene/scalene_json.py103 except Exception:
LOWscalene/scalene_apple_gpu.py225 except Exception:
LOWscalene/scalene_jax.py72 except Exception:
LOWscalene/scalene_jax.py91 except Exception:
MEDIUMscalene/scalene_neuron.py195 print(f"Error decoding JSON: {e}")
LOWscalene/scalene_neuron.py196 except Exception as e:
MEDIUMscalene/scalene_neuron.py96def has_gpu(self) -> bool:
LOWscalene/scalene_windows.py136 except Exception as e:
MEDIUMscalene/merge_scalene_neuron_profiles.py121 print(f"Error parsing {scalene_file}: {e}")
LOWscalene/scalene_library_profiler.py178 except Exception:
LOWscalene/scalene_library_profiler.py203 except Exception:
LOWscalene/__main__.py12 except Exception as exc:
MEDIUMscalene/__main__.py5def main() -> None:
LOWscalene/scalene_mapfile.py262 except Exception:
MEDIUMscalene/redirect_python.py40 print(f"Error writing to {fname}: {e}")
LOWscalene/scalene_lifecycle.py162 except Exception:
LOWscalene/scalene_lifecycle.py184 except Exception:
LOWbenchmarks/benchmark.py208 except Exception as err:
Deep Nesting44 hits · 42 pts
SeverityFileLineSnippet
LOWtest/test_tracer.py104
LOWtest/test_tracer.py240
LOWtest/original/bm_scimark.py226
LOWtest/original/bm_pyflate.py398
LOWtest/original/bm_pyflate.py551
LOWtest/optimized/bm_scimark.py228
LOWtest/optimized/bm_pyflate.py401
LOWtest/optimized/bm_pyflate.py558
LOWtests/test_multiprocessing_pool_spawn.py19
LOWtests/test_coverup_71.py13
LOWtests/test_coverup_87.py80
LOWtests/test_perthread_stack_stitching.py402
LOWtests/test_memory_stacks_bigmem.py43
LOWscalene/scalene_preload.py23
LOWscalene/scalene_memory_profiler.py102
LOWscalene/scalene_profiler.py852
LOWscalene/scalene_profiler.py979
LOWscalene/scalene_profiler.py1772
LOWscalene/scalene_utility.py543
LOWscalene/scalene_utility.py625
LOWscalene/scalene_signal_manager.py318
LOWscalene/scalene_parseargs.py199
LOWscalene/scalene_parseargs.py585
LOWscalene/scalene_tensorflow.py47
LOWscalene/scalene_torch.py185
LOWscalene/scalene_tracing.py131
LOWscalene/scalene_json.py708
LOWscalene/scalene_output.py277
LOWscalene/scalene_statistics.py907
LOWscalene/scalene_neuron.py125
LOWscalene/scalene_cpu_profiler.py49
LOWscalene/merge_scalene_neuron_profiles.py9
LOWscalene/merge_scalene_neuron_profiles.py96
LOWscalene/scalene_library_profiler.py163
LOWscalene/scalene_analysis.py18
LOWscalene/scalene_analysis.py69
LOWscalene/scalene_analysis.py101
LOWscalene/scalene_analysis.py136
LOWscalene/scalene_analysis.py168
LOWscalene/scalene_analysis.py175
LOWscalene/scalene_nvidia_gpu.py112
LOWbenchmarks/new_benchmark.py42
LOWbenchmarks/pystone.py198
LOWbenchmarks/measure_profiler_memory.py42
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippet
HIGHtest/original/bm_raytrace.py0this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f
HIGHtest/optimized/bm_raytrace.py0this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f
HIGHtest/expensive_benchmarks/bm_raytrace.py0this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f
HIGHtest/automatic/svm/svm-original.py0compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th
HIGHtest/automatic/svm/svm-optimized.py0compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th
HIGHtest/automatic/svm/svm-optimized.py0compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALscalene/scalene-gui/jquery-3.6.0.slim.min.js2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):f
AI Slop Vocabulary4 hits · 8 pts
SeverityFileLineSnippet
LOWsetup.py291 # so it seems best to just use them and let it error out if not recognized.
LOWtests/test_coverup_66.py39 # Mock webbrowser.get().open to simply return True
MEDIUMscalene/scalene-gui/package-lock.json2585 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",
MEDIUMsrc/include/traceconfig.hpp99 // installed ``scalene.__file__``). This is the robust check: it
Dead Code4 hits · 8 pts
SeverityFileLineSnippet
MEDIUMtest/original/bm_pyflate.py236
MEDIUMtest/optimized/bm_scimark.py20
MEDIUMtest/optimized/bm_scimark.py22
MEDIUMtest/optimized/bm_pyflate.py237
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippet
HIGHscalene/scalene_parseargs.py164Load and parse a YAML configuration file. Args: config_path: Path to the YAML config file
Overly Generic Function Names3 hits · 3 pts
SeverityFileLineSnippet
LOWtests/test_coverup_55.py20 def my_method(self):
LOWtests/test_coverup_16.py12 def my_method(self):
LOWscalene/scalene-gui/scalene-gui.ts3046function doSomething(e: ProgressEvent<FileReader>): void {
Slop Phrases2 hits · 2 pts
SeverityFileLineSnippet
MEDIUMscalene/scalene_tensorflow.py10This is a basic implementation that captures overall timing.
MEDIUMscalene/scalene_jax.py10This is a basic implementation that captures overall timing.
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippet
LOWtests/test_coverup_66.py58 # we don't have direct access to the variable name. We need to check if the directory