Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
935 matches across 17 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 186 | def fetch_vendor_deps_windows(): |
| LOW | setup.py | 303 | def _fix_windows_arch_mismatch(self): |
| LOW | setup.py | 429 | def copy_extensions_to_source(self): |
| LOW | test/test_sparkline.py | 19 | def test_get_bars__in_wsl_and_windows_terminal(monkeypatch): |
| LOW | test/test_sparkline.py | 35 | def test_generate__up_and_down(): |
| LOW | test/test_sparkline.py | 43 | def test_generate__all_zeroes(): |
| LOW | test/test_sparkline.py | 51 | def test_generate__with_negative_values(): |
| LOW | test/test_sparkline.py | 67 | def test_generate__with_max_same_as_actual_max(): |
| LOW | test/test_sparkline.py | 75 | def test_generate__with_max_below_actual_max(): |
| LOW | test/test_tracer.py | 117 | def test_sys_monitoring_default(self): |
| LOW | test/test_tracer.py | 157 | def test_using_sys_monitoring(self): |
| LOW | test/test_tracer.py | 166 | def test_set_use_legacy_tracer(self): |
| LOW | test/test_tracer.py | 187 | def test_pywhere_sysmon_available(self): |
| LOW | test/test_tracer.py | 240 | def test_function_call_attribution(self): |
| LOW | test/issues/test-issue167.py | 18 | def get_mean_for_indicator_poor(df, indicator): |
| LOW | test/issues/test-issue167.py | 28 | def get_mean_for_indicator_better(df, indicator, rnd_cols): |
| LOW | tests/test_memory_multithreaded_gil_release.py | 48 | def test_worker_alloc_outweighs_main_sleep(tmp_path: Path) -> None: |
| LOW | tests/test_memory_multithreaded_gil_release.py | 84 | def test_memory_stacks_leaf_is_worker(tmp_path: Path) -> None: |
| LOW | tests/test_cpu_attribution.py | 236 | def test_c_time_attributed_to_call_line(self, profiler, stats): |
| LOW | tests/test_cpu_attribution.py | 275 | def test_pure_python_no_preceding_call(self, profiler, stats): |
| LOW | tests/test_cpu_attribution.py | 306 | def test_multi_consecutive_c_calls(self, profiler, stats): |
| LOW | tests/test_cpu_attribution.py | 359 | def test_thread_at_call_instruction_attributes_to_c(self, profiler, stats): |
| LOW | tests/test_cpu_attribution.py | 422 | def test_at_call_instruction_attributes_to_c( |
| LOW | tests/test_cpu_attribution.py | 461 | def test_not_at_call_attributes_to_python( |
| LOW | tests/test_cpu_attribution.py | 556 | def test_first_body_line_detected(self) -> None: |
| LOW | tests/test_cpu_attribution.py | 578 | def test_non_loop_line_returns_none(self) -> None: |
| LOW | tests/test_cpu_attribution.py | 589 | def test_mid_body_line_returns_none(self) -> None: |
| LOW | tests/test_cpu_attribution.py | 604 | def test_loop_with_calls_returns_none(self) -> None: |
| LOW | tests/test_cpu_attribution.py | 624 | def test_nested_loop_picks_innermost(self) -> None: |
| LOW | tests/test_cpu_attribution.py | 651 | def test_loop_body_time_redistributed(self, profiler: ScaleneCPUProfiler, stats: ScaleneStatistics) -> None: |
| LOW | tests/test_cpu_attribution.py | 702 | def test_no_loop_redistribution_mid_body(self, profiler: ScaleneCPUProfiler, stats: ScaleneStatistics) -> None: |
| LOW | tests/test_coverup_98.py | 26 | def test_remove_nonexistent_child_pid(): |
| LOW | tests/test_line_attribution_nested.py | 99 | def test_mallocs_credited_to_allocator_not_caller(tmp_path: Path) -> None: |
| LOW | tests/test_line_attribution_nested.py | 140 | def test_memory_samples_timeline_only_on_allocator(tmp_path: Path) -> None: |
| LOW | tests/test_line_attribution_nested.py | 172 | def test_memory_stacks_leaf_is_allocator(tmp_path: Path) -> None: |
| LOW | tests/test_coverup_121.py | 17 | def test_launch_browser_insecure_on_mac(mock_platform_system): |
| LOW | tests/test_coverup_121.py | 31 | def test_launch_browser_insecure_on_windows(mock_platform_system): |
| LOW | tests/test_sysmon_tool_id_conflict.py | 22 | def test_fallback_when_profiler_id_taken(self): |
| LOW | tests/test_sysmon_tool_id_conflict.py | 51 | def test_fallback_to_legacy_when_all_ids_taken(self): |
| LOW | tests/test_sysmon_tool_id_conflict.py | 89 | def test_profiling_works_with_id_conflict(self): |
| LOW | tests/test_sysmon_tool_id_conflict.py | 210 | def test_scalene_with_torch_profiler(self): |
| LOW | tests/test_memory_multithreaded_stacks.py | 49 | def test_memory_stacks_cover_both_workers(tmp_path: Path) -> None: |
| LOW | tests/test_memory_multithreaded_stacks.py | 78 | def test_memory_stacks_leaves_are_fixture(tmp_path: Path) -> None: |
| LOW | tests/test_coverup_131.py | 18 | def test_profile_this_code_without_files_to_profile(scalene_cleanup): |
| LOW | tests/test_coverup_125.py | 13 | def scalene_setup_and_teardown(): |
| LOW | tests/test_coverup_125.py | 38 | def test_start_signal_handler(scalene_setup_and_teardown): |
| LOW | tests/test_jax_profiler.py | 41 | def test_jax_profiler_is_available_matches_import(self): |
| LOW | tests/test_jax_profiler.py | 51 | def test_jax_profiler_get_line_time_default(self): |
| LOW | tests/test_jax_profiler.py | 57 | def test_jax_profiler_get_gpu_line_time_default(self): |
| LOW | tests/test_jax_profiler.py | 93 | def test_jax_profiler_line_time_conversion(self): |
| LOW | tests/test_jax_profiler.py | 103 | def test_jax_profiler_gpu_line_time_conversion(self): |
| LOW | tests/test_jax_profiler.py | 113 | def test_jax_profiler_get_all_times(self): |
| LOW | tests/test_jax_profiler.py | 26 | def test_jax_profiler_extends_base_class(self): |
| LOW | tests/test_jax_profiler.py | 78 | def test_jax_profiler_has_gpu_timing(self): |
| LOW | tests/test_jax_profiler.py | 145 | def test_start_without_jax_is_noop(self): |
| LOW | tests/test_jax_profiler.py | 154 | def test_stop_without_start_is_safe(self): |
| LOW | tests/test_jax_profiler.py | 166 | def test_jax_profiler_start_stop(self): |
| LOW | tests/test_jax_profiler.py | 187 | def test_jax_profiler_captures_operations(self): |
| LOW | tests/test_jax_profiler.py | 216 | def test_jax_profiler_trace_dir_cleanup(self): |
| LOW | tests/test_jax_profiler.py | 237 | def test_jax_profiler_multiple_start_stop(self): |
| 350 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | test/test_freethreaded_parity.py | 23 | # ── Workload scripts ──────────────────────────────────────────────── |
| MEDIUM | test/test_freethreaded_parity.py | 156 | # ── Helpers ───────────────────────────────────────────────────────── |
| MEDIUM | test/test_freethreaded_parity.py | 269 | # ── Test phases ───────────────────────────────────────────────────── |
| MEDIUM | test/test_freethreaded_parity.py | 581 | # ── Main ──────────────────────────────────────────────────────────── |
| MEDIUM | …t/expensive_benchmarks/docutils_data/docs/dev/todo.txt | 807 | # ================= |
| MEDIUM | tests/test_cpu_attribution.py | 30 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 33 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 154 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 156 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 174 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 176 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 218 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 220 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 397 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 399 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 500 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_cpu_attribution.py | 502 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_nested_package_relative_import.py | 15 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_nested_package_relative_import.py | 17 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_nested_package_relative_import.py | 41 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_nested_package_relative_import.py | 43 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_nested_package_relative_import.py | 64 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_nested_package_relative_import.py | 66 | # ------------------------------------------------------------------ |
| MEDIUM | tests/test_child_cmdline.py | 53 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_child_cmdline.py | 55 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_child_cmdline.py | 128 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_child_cmdline.py | 130 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_child_cmdline.py | 153 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_child_cmdline.py | 157 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_issue999_wallclock.py | 26 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_issue999_wallclock.py | 28 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 155 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 157 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 186 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 188 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 870 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 872 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 1212 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 1214 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 1511 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 1513 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 59 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 61 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 694 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 696 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 292 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_native_stacks.py | 294 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 93 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 95 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 320 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 322 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 344 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 346 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 400 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 402 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 30 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/test_on_off_windows.py | 32 | # --------------------------------------------------------------------------- |
| MEDIUM | scalene/scalene_apple_gpu.py | 7 | # --------------------------------------------------------------------------- |
| MEDIUM | scalene/scalene_apple_gpu.py | 9 | # --------------------------------------------------------------------------- |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | test/test-size.py | 1 | |
| LOW | test/test_sparkline.py | 1 | |
| LOW | test/multiprocessing_test.py | 1 | |
| LOW | test/multiprocessing_test.py | 3 | |
| LOW | test/smoketest_issue_1022.py | 39 | |
| LOW | test/profile_annotation_test.py | 14 | |
| LOW | test/profile_annotation_test.py | 80 | |
| LOW | test/small_mp_test.py | 2 | |
| LOW | test/small_mp_test.py | 3 | |
| LOW | test/small_mp_test.py | 4 | |
| LOW | test/threads-test.py | 2 | |
| LOW | test/testflask-driver.py | 1 | |
| LOW | test/testflask-driver.py | 2 | |
| LOW | test/pool-test.py | 1 | |
| LOW | test/new_mp_test.py | 2 | |
| LOW | test/testme.py | 2 | |
| LOW | test/test-martinheinz.py | 1 | |
| LOW | test/original/bm_richards.py | 12 | |
| LOW | test/automatic/dataframe/dataframe-select-optimized.py | 3 | |
| LOW | test/automatic/dataframe/dataframe-select-original.py | 3 | |
| LOW | test/optimized/bm_richards.py | 12 | |
| LOW | test/expensive_benchmarks/bm_async_tree_io.py | 24 | |
| LOW | test/expensive_benchmarks/bm_docutils.py | 6 | |
| LOW | test/expensive_benchmarks/bm_docutils.py | 10 | |
| LOW | test/expensive_benchmarks/bm_docutils.py | 12 | |
| LOW | test/expensive_benchmarks/bm_fannukh.py | 9 | |
| LOW | test/issues/test-issue167.py | 1 | |
| LOW | test/issues/test-issue379.py | 1 | |
| LOW | test/issues/test-issue130.py | 1 | |
| LOW | test/issues/test-issue266.py | 1 | |
| LOW | test/issues/test-issue266.py | 3 | |
| LOW | tests/test_memory_multithreaded_gil_release.py | 22 | |
| LOW | tests/test_coverup_110.py | 5 | |
| LOW | tests/test_coverup_98.py | 5 | |
| LOW | tests/test_line_attribution_nested.py | 17 | |
| LOW | tests/test_coverup_115.py | 7 | |
| LOW | tests/test_coverup_115.py | 7 | |
| LOW | tests/test_coverup_121.py | 6 | |
| LOW | tests/test_sysmon_tool_id_conflict.py | 135 | |
| LOW | tests/test_sysmon_tool_id_conflict.py | 221 | |
| LOW | tests/test_memory_multithreaded_stacks.py | 18 | |
| LOW | tests/test_coverup_89.py | 7 | |
| LOW | tests/test_coverup_65.py | 5 | |
| LOW | tests/test_coverup_34.py | 5 | |
| LOW | tests/test_coverup_24.py | 5 | |
| LOW | tests/test_coverup_24.py | 7 | |
| LOW | tests/test_coverup_30.py | 7 | |
| LOW | tests/test_coverup_55.py | 7 | |
| LOW | tests/test_coverup_45.py | 5 | |
| LOW | tests/test_coverup_71.py | 7 | |
| LOW | tests/test_coverup_71.py | 9 | |
| LOW | tests/test_memory_arithmetic_smear.py | 23 | |
| LOW | tests/test_memory_two_allocators.py | 15 | |
| LOW | tests/test_coverup_54.py | 5 | |
| LOW | tests/test_coverup_54.py | 6 | |
| LOW | tests/test_coverup_54.py | 7 | |
| LOW | tests/test_coverup_54.py | 8 | |
| LOW | tests/test_coverup_15.py | 6 | |
| LOW | tests/test_coverup_15.py | 9 | |
| LOW | tests/test_coverup_83.py | 8 | |
| 101 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/test_sysmon_tool_id_conflict.py | 139 | # Create a test script that uses PyTorch |
| MEDIUM | tests/test_sysmon_tool_id_conflict.py | 225 | # Create a test script that uses torch.profiler |
| MEDIUM | tests/test_coverup_125.py | 19 | # Create a child process and add its PID to the set |
| MEDIUM | tests/test_jax_profiler.py | 402 | # Create a realistic trace file with multiple events |
| MEDIUM | tests/test_jax_profiler.py | 527 | # Create a temporary trace file |
| MEDIUM | tests/test_tensorflow_profiler.py | 492 | # Create a realistic trace file with multiple events |
| MEDIUM | tests/test_coverup_24.py | 14 | # Create a test function to execute the missing lines/branches |
| MEDIUM | tests/test_coverup_75.py | 28 | # Create a temporary file to ensure the test environment is clean |
| MEDIUM | tests/test_coverup_30.py | 28 | # Create a ScaleneArguments object with default arguments |
| MEDIUM | tests/test_coverup_20.py | 34 | # Create a dummy profile file |
| MEDIUM | tests/test_coverup_20.py | 48 | # Create a dummy profile file |
| MEDIUM | tests/test_coverup_15.py | 16 | # Create a temporary directory for the test |
| MEDIUM | tests/test_coverup_53.py | 13 | # Define a fixture to clean up state after each test |
| MEDIUM | tests/test_coverup_53.py | 38 | # Create a Namespace object with the necessary attributes |
| MEDIUM | tests/test_coverup_118.py | 36 | frame = MagicMock() # Create a MagicMock frame to simulate the behavior |
| MEDIUM | tests/test_coverup_84.py | 18 | # Create a temporary file to simulate the malloc lock file |
| MEDIUM | tests/test_torch_profiler.py | 132 | # Define a JIT function in this file so we know the filename |
| MEDIUM | tests/test_torch_profiler.py | 338 | # Create a test script that uses JIT - must run long enough to profile |
| MEDIUM | tests/test_perthread_stack_stitching.py | 424 | # Create a minimal test script that runs worker threads |
| MEDIUM | tests/test_coverup_109.py | 15 | # Define a simple HTTP server for testing purposes |
| MEDIUM | tests/test_coverup_109.py | 44 | # Create a temporary HTML file |
| MEDIUM | tests/test_coverup_109.py | 45 | temp_dir = tempfile.mkdtemp() # Create a new temporary directory |
| MEDIUM | tests/test_coverup_91.py | 11 | # Create a mock function to be decorated |
| MEDIUM | tests/test_coverup_17.py | 19 | # Define a process function that will be called by the queue |
| MEDIUM | tests/test_coverup_17.py | 27 | # Create an instance of ScaleneSigQueue |
| MEDIUM | tests/test_coverup_139.py | 22 | # Create a fake frame object using MagicMock |
| MEDIUM | tests/test_coverup_116.py | 20 | # Create a temporary profile file with some content |
| MEDIUM | tests/test_coverup_122.py | 12 | # Define a test function to improve coverage |
| MEDIUM | tests/test_coverup_122.py | 15 | # Create a temporary file to simulate a Python script |
| MEDIUM | tests/test_coverup_137.py | 29 | # Define a dummy function to be decorated |
| MEDIUM | tests/test_coverup_19.py | 15 | # Create a temporary directory to simulate a native package with a .so file |
| MEDIUM | tests/test_coverup_68.py | 18 | # Define the source and destination dictionaries |
| MEDIUM | tests/test_coverup_133.py | 10 | # Create a dummy function to profile |
| MEDIUM | scalene/scalene_profiler.py | 403 | # Create a temporary directory to hold aliases to the Python |
| MEDIUM | scalene/scalene_utility.py | 823 | # Create a new error with just the custom message |
| MEDIUM | scalene/scalene_magics.py | 40 | # Create a file to hold the supplied code. |
| MEDIUM | scalene/launchbrowser.py | 26 | # Create a temporary directory |
| MEDIUM | scalene/launchbrowser.py | 28 | # Create a command with the required flags |
| MEDIUM | scalene/scalene_tensorflow.py | 114 | # Create a temporary directory for traces |
| MEDIUM | scalene/scalene_signals.py | 1 | # Import the necessary libraries. |
| MEDIUM | scalene/scalene_statistics.py | 569 | # Create a temporary instance to inspect attributes |
| MEDIUM | scalene/scalene_statistics.py | 705 | # Initialize statistics classes |
| MEDIUM | scalene/scalene_statistics.py | 871 | # Create a file in the Python alias directory with the relevant info. |
| MEDIUM | scalene/scalene_jax.py | 65 | # Create a temporary directory for traces |
| MEDIUM | scalene/scalene_windows.py | 151 | # Create a C callback wrapper |
| MEDIUM | scalene/scalene_analysis.py | 33 | # This module is not installed or something else went wrong; fail gracefully. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | setup.py | 179 | print("Please install Node.js and run 'npm install && npm run build' in scalene/scalene-gui/") |
| HIGH | tests/test_runningstats.py | 22 | rstats.push(value) |
| HIGH | tests/test_coverup_41.py | 16 | running_stats.push(1) |
| HIGH | tests/test_coverup_41.py | 18 | running_stats.push(2) |
| HIGH | tests/test_coverup_4.py | 16 | running_stats.push(10.0) |
| HIGH | tests/test_coverup_4.py | 22 | running_stats.push(20.0) |
| HIGH | tests/test_coverup_4.py | 28 | running_stats.push(5.0) |
| HIGH | tests/test_coverup_40.py | 11 | stats.push(10) |
| HIGH | tests/test_coverup_40.py | 12 | stats.push(20) |
| HIGH | tests/test_coverup_40.py | 13 | stats.push(5) |
| HIGH | tests/test_coverup_39.py | 11 | stats.push(1) |
| HIGH | tests/test_coverup_39.py | 12 | stats.push(2) |
| HIGH | tests/test_coverup_39.py | 13 | stats.push(3) |
| HIGH | scalene/scalene_output.py | 364 | file=null, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 124 | # Check if node_modules exists (dependencies installed) |
| LOW | test/smoketest.py | 62 | # Check if the target path parts appear at the end of the profiled path |
| LOW | tests/test_coverup_88.py | 22 | # Check if __in_jupyter is now True |
| LOW | tests/test_coverup_31.py | 15 | # Set attributes to non-default values |
| LOW | tests/test_coverup_31.py | 23 | # Check if the attributes are reset to their default values |
| LOW | tests/test_coverup_15.py | 31 | # Check if the sys.executable has been changed |
| LOW | tests/test_coverup_15.py | 33 | # Check if the sys.path has been updated |
| LOW | tests/test_coverup_15.py | 35 | # Check if the PATH environment variable has been updated |
| LOW | tests/test_coverup_15.py | 37 | # Check if the files have been created |
| LOW | tests/test_coverup_118.py | 39 | frame.f_back = None # Set f_back to None to trigger the return in line 1171 |
| LOW | tests/test_coverup_77.py | 16 | # Check if elapsed_time has been updated |
| LOW | tests/test_coverup_77.py | 18 | # Check if start_time has been reset to 0 |
| LOW | tests/test_torch_profiler.py | 368 | # Check if profile was generated |
| LOW | tests/test_torch_profiler.py | 376 | # Check if we have files to analyze |
| LOW | tests/test_perthread_stack_stitching.py | 416 | # Check if native unwinding is available |
| LOW | tests/test_coverup_109.py | 73 | # Check if the current directory was restored |
| LOW | tests/test_coverup_139.py | 26 | # Check if the queue put method was called with the correct arguments |
| LOW | tests/test_coverup_116.py | 31 | # Check if the output file was created and has content |
| LOW | tests/test_coverup_116.py | 37 | # Check if the output file contains the profile content |
| LOW | tests/test_coverup_106.py | 27 | # Check if the signal.SIGVTALRM is in the returned tuple |
| LOW | tests/test_coverup_106.py | 29 | # Check if the returned tuple only contains timer signals |
| LOW | tests/test_coverup_59.py | 27 | # Check if decimation occurred |
| LOW | tests/test_coverup_59.py | 31 | # Check if the median was correctly calculated |
| LOW | tests/test_coverup_59.py | 56 | # Check if decimation occurred |
| LOW | tests/test_coverup_59.py | 60 | # Check if the median was correctly calculated |
| LOW | tests/test_coverup_107.py | 24 | # Check if Scalene is now initialized |
| LOW | scalene/scalene_memory_profiler.py | 191 | # Iterate through the array to compute the new current footprint |
| LOW | scalene/scalene_profiler.py | 1132 | # Check if it's time to print profiling info. |
| LOW | scalene/scalene_utility.py | 244 | # Set frame to None so we skip this frame entirely. |
| LOW | scalene/scalene_parseargs.py | 266 | # Check if --help-advanced is in the arguments |
| LOW | scalene/scalene_parseargs.py | 810 | # Check if we should print this line |
| LOW | scalene/scalene_parseargs.py | 954 | # Check if the profile file exists |
| LOW | scalene/scalene_parseargs.py | 1159 | # Check if user provided a .py file without a subcommand |
| LOW | scalene/scalene_parseargs.py | 1168 | # Check if any argument looks like a Python file or module |
| LOW | scalene/scalene_tensorflow.py | 22 | # Check if TensorFlow is available at import time |
| LOW | scalene/scalene_torch.py | 19 | # Check if PyTorch is available at import time |
| LOW | scalene/scalene_tracing.py | 93 | # Check if this function is specifically decorated for profiling |
| LOW | scalene/scalene_tracing.py | 232 | # Check if the file is in the same directory tree as the program being profiled. |
| LOW | scalene/scalene_tracing.py | 236 | # Check if file is in program's directory or a subdirectory |
| LOW | scalene/scalene_json.py | 505 | # Check if this line has PyTorch profiler timing (for JIT-compiled code) |
| LOW | scalene/scalene_json.py | 668 | # Check if the function at this line is a coroutine |
| LOW | scalene/scalene_tracer.py | 21 | # Check if we're running Python 3.12+ where sys.monitoring is available |
| LOW | scalene/scalene_tracer.py | 24 | # Check if we're running Python 3.12+ where the C API for sys.monitoring is available |
| LOW | scalene/scalene_tracer.py | 230 | # Check if we're still on the same line |
| LOW | scalene/scalene_tracer.py | 236 | # Check if the original line is still on the call stack. |
| LOW | scalene/scalene_jax.py | 22 | # Check if JAX is available at import time |
| LOW | scalene/set_nvidia_gpu_modes.py | 38 | # Check if the script is running as root |
| LOW | scalene/scalene_cpu_profiler.py | 436 | # Check if the original caller is stuck inside a call |
| LOW | scalene/merge_scalene_neuron_profiles.py | 41 | # Check if source matches any of the files in scalene profile |
| LOW | scalene/merge_scalene_neuron_profiles.py | 85 | # Check if CPU sample overlaps with any interval (strict overlap) |
| LOW | scalene/merge_scalene_neuron_profiles.py | 87 | # Check if CPU sample falls within interval exactly |
| LOW | scalene/merge_scalene_neuron_profiles.py | 278 | # Check if this line has neuron events |
| LOW | scalene/scalene_analysis.py | 62 | # Check if the node represents an import statement |
| LOW | scalene/scalene_analysis.py | 92 | # Check if the node represents an import from statement |
| LOW | scalene/scalene_nvidia_gpu.py | 57 | # Check if each GPU has accounting mode set. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | mypy.ini | 21 | # It's useful to try this occasionally, and keep it clean; but when |
| LOW | setup.py | 521 | |
| LOW | .readthedocs.yaml | 21 | # builder: "dirhtml" |
| LOW | test/test_freethreaded_parity.py | 541 | print(f"\n Memory scaling (8T / 1T): {ratio_8_to_1:.2f}x (nominal 8x)") |
| LOW | test/original/bm_pyflate.py | 361 | base[symbol] += 1 |
| LOW | test/optimized/bm_raytrace.py | 421 | # args.width, args.height, |
| LOW | …e_benchmarks/docutils_data/docs/dev/enthought-plan.txt | 181 | Python doesn't have multi-line comments; only single-line. A similar |
| LOW | tests/test_coverup_14.py | 21 | assert len(signals) == len(set(signals)) |
| LOW | tests/test_coverup_17.py | 61 | # Before each test |
| LOW | tests/test_native_stacks.py | 441 | async def main(): |
| LOW | scalene/scalene_memory_profiler.py | 281 | # |
| LOW | scalene/scalene_memory_profiler.py | 301 | # next legitimate sparkline sample reflects the right |
| LOW | scalene/replacement_asyncio.py | 21 | # Nothing to do here - activation is handled by the profiler |
| LOW | scalene/scalene_arguments.py | 121 | whose dest async_profile defaults to True). |
| LOW | scalene/scalene_profiler.py | 721 | assert f |
| LOW | scalene/scalene_profiler.py | 821 | alloc_sigq, |
| LOW | scalene/scalene_profiler.py | 901 | signal_all_threads() |
| LOW | scalene/scalene_profiler.py | 1901 | # Handle direct invocation of a string by executing the string and returning. |
| LOW | scalene/scalene_utility.py | 61 | except ImportError: |
| LOW | scalene/scalene_utility.py | 661 | recorded = False |
| LOW | scalene/scalene_utility.py | 1001 | # --------------------------------------------------------------------------- # |
| LOW | scalene/scalene_json.py | 161 | |
| LOW | scalene/scalene_json.py | 401 | # Stitched Python+native call stacks (emitted when --stacks is set). |
| LOW | scalene/scalene_json.py | 801 | # read ``native_stacks`` independently. See P6 in the |
| LOW | scalene/scalene_json.py | 821 | resolve = None |
| LOW | scalene/scalene_json.py | 1001 | # attributable to any source line, so surface them at the top level. |
| LOW | scalene/scalene_json.py | 1141 | # the on-wire [module, symbol, ip, offset] list at the output |
| LOW | scalene/scalene_statistics.py | 661 | # frame tuples (outermost-first). Native IPs are resolved (and |
| LOW | scalene/scalene_statistics.py | 681 | |
| LOW | scalene/scalene_cpu_profiler.py | 101 | elapsed.wallclock = elapsed.user |
| LOW | scalene/scalene_cpu_profiler.py | 221 | # The interval-based formula gives us: |
| LOW | scalene/scalene-gui/scalene-gui.ts | 1201 | // so frame widths are proportional to bytes attributed to that call path |
| LOW | scalene/scalene-gui/scalene-gui.ts | 1381 | // - Top: time-axis ruler with labeled ticks at a "nice" interval |
| LOW | scalene/scalene-gui/scalene-gui.ts | 1401 | const TIMELINE_BUCKETS = 600; // resolution along x (vertical pixel columns). |
| LOW | scalene/scalene-gui/scalene-gui.ts | 1821 | // Format a time value in seconds for the axis ruler. Uses ms for values |
| LOW | benchmarks/new_benchmark.py | 1 | import json |
| LOW | benchmarks/new_benchmark.py | 21 | # "run", |
| LOW | .github/workflows/test-smoketests.yml | 61 | # always-passing checks come last as smoke for the lifecycle bits. |
| LOW | src/include/sampleheap.hpp | 1 | #pragma once |
| LOW | src/include/sampleheap.hpp | 21 | #include <sys/types.h> |
| LOW | src/include/samplefile_win.hpp | 1 | #pragma once |
| LOW | src/include/common_win.hpp | 1 | #pragma once |
| LOW | src/include/common_win.hpp | 21 | #else |
| LOW | src/include/common_win.hpp | 41 | #endif |
| LOW | src/include/traceconfig.hpp | 1 | #pragma once |
| LOW | src/include/traceconfig.hpp | 81 | // Return false if filename contains paths corresponding to the native |
| LOW | src/include/traceconfig.hpp | 101 | // parent directory that is not literally called "scalene". |
| LOW | src/include/sampler.hpp | 1 | #pragma once |
| LOW | src/include/sampler.hpp | 21 | |
| LOW | src/include/sampleheap_win.hpp | 1 | #pragma once |
| LOW | src/include/mallocrecursionguard.hpp | 1 | #pragma once |
| LOW | src/include/sharded_size_map.hpp | 1 | #pragma once |
| LOW | src/include/common.hpp | 1 | #pragma once |
| LOW | src/include/common.hpp | 21 | #define ATTRIBUTE_ALIGNED(s) __attribute__((aligned(s))) |
| LOW | src/include/samplefile.hpp | 1 | #pragma once |
| LOW | src/include/samplefile.hpp | 81 | __LINE__); |
| LOW | src/include/pywhere.hpp | 1 | #ifndef __PYWHERE_H |
| LOW | src/include/memcpysampler.hpp | 1 | #pragma once |
| LOW | src/include/memcpysampler.hpp | 21 | #include <sys/types.h> |
| LOW | src/include/scaleneheader.hpp | 1 | #ifndef SCALENE_HEADER_H |
| 12 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 425 | except Exception as e: |
| LOW | tests/test_sysmon_tool_id_conflict.py | 240 | except Exception as e: |
| LOW | scalene/scalene_profiler.py | 364 | except Exception as e: |
| LOW | scalene/scalene_profiler.py | 1305 | except Exception: |
| LOW | scalene/scalene_profiler.py | 1366 | except Exception: |
| LOW | scalene/scalene_profiler.py | 1417 | except Exception: |
| LOW | scalene/scalene_profiler.py | 1530 | except Exception as e: |
| LOW | scalene/scalene_profiler.py | 1808 | except Exception as e: |
| LOW | scalene/scalene_profiler.py | 1885 | except Exception: |
| LOW | scalene/scalene_profiler.py | 1927 | except Exception: |
| LOW | scalene/scalene_profiler.py | 1956 | except Exception as ex: |
| LOW | scalene/scalene_profiler.py | 2069 | except Exception as ex: |
| LOW | scalene/scalene_profiler.py | 2088 | except Exception: |
| LOW | scalene/scalene_utility.py | 172 | except Exception: |
| LOW | scalene/scalene_utility.py | 315 | except Exception: |
| LOW | scalene/scalene_utility.py | 349 | except Exception: |
| LOW | scalene/scalene_utility.py | 370 | except Exception: |
| LOW | scalene/scalene_utility.py | 388 | except Exception: |
| LOW | scalene/scalene_utility.py | 403 | except Exception: |
| LOW | scalene/scalene_utility.py | 423 | except Exception: |
| LOW | scalene/scalene_utility.py | 436 | except Exception: |
| LOW | scalene/scalene_utility.py | 465 | except Exception: |
| LOW | scalene/scalene_parseargs.py | 971 | except Exception as e: |
| LOW | scalene/scalene_tensorflow.py | 145 | except Exception: |
| LOW | scalene/scalene_tensorflow.py | 164 | except Exception: |
| LOW | scalene/scalene_async.py | 314 | except Exception: |
| LOW | scalene/scalene_torch.py | 115 | except Exception: |
| LOW | scalene/scalene_torch.py | 150 | except Exception: |
| LOW | scalene/scalene_torch.py | 152 | except Exception: |
| LOW | scalene/scalene_torch.py | 169 | except Exception: |
| LOW | scalene/scalene_torch.py | 178 | except Exception: |
| LOW | scalene/scalene_torch.py | 219 | except Exception: |
| LOW | scalene/scalene_torch.py | 248 | except Exception: |
| LOW | scalene/scalene_tracing.py | 191 | except Exception: |
| LOW | scalene/scalene_json.py | 103 | except Exception: |
| LOW | scalene/scalene_apple_gpu.py | 225 | except Exception: |
| LOW | scalene/scalene_jax.py | 72 | except Exception: |
| LOW | scalene/scalene_jax.py | 91 | except Exception: |
| MEDIUM | scalene/scalene_neuron.py | 195 | print(f"Error decoding JSON: {e}") |
| LOW | scalene/scalene_neuron.py | 196 | except Exception as e: |
| MEDIUM | scalene/scalene_neuron.py | 96 | def has_gpu(self) -> bool: |
| LOW | scalene/scalene_windows.py | 136 | except Exception as e: |
| MEDIUM | scalene/merge_scalene_neuron_profiles.py | 121 | print(f"Error parsing {scalene_file}: {e}") |
| LOW | scalene/scalene_library_profiler.py | 178 | except Exception: |
| LOW | scalene/scalene_library_profiler.py | 203 | except Exception: |
| LOW | scalene/__main__.py | 12 | except Exception as exc: |
| MEDIUM | scalene/__main__.py | 5 | def main() -> None: |
| LOW | scalene/scalene_mapfile.py | 262 | except Exception: |
| MEDIUM | scalene/redirect_python.py | 40 | print(f"Error writing to {fname}: {e}") |
| LOW | scalene/scalene_lifecycle.py | 162 | except Exception: |
| LOW | scalene/scalene_lifecycle.py | 184 | except Exception: |
| LOW | benchmarks/benchmark.py | 208 | except Exception as err: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | test/test_tracer.py | 104 | |
| LOW | test/test_tracer.py | 240 | |
| LOW | test/original/bm_scimark.py | 226 | |
| LOW | test/original/bm_pyflate.py | 398 | |
| LOW | test/original/bm_pyflate.py | 551 | |
| LOW | test/optimized/bm_scimark.py | 228 | |
| LOW | test/optimized/bm_pyflate.py | 401 | |
| LOW | test/optimized/bm_pyflate.py | 558 | |
| LOW | tests/test_multiprocessing_pool_spawn.py | 19 | |
| LOW | tests/test_coverup_71.py | 13 | |
| LOW | tests/test_coverup_87.py | 80 | |
| LOW | tests/test_perthread_stack_stitching.py | 402 | |
| LOW | tests/test_memory_stacks_bigmem.py | 43 | |
| LOW | scalene/scalene_preload.py | 23 | |
| LOW | scalene/scalene_memory_profiler.py | 102 | |
| LOW | scalene/scalene_profiler.py | 852 | |
| LOW | scalene/scalene_profiler.py | 979 | |
| LOW | scalene/scalene_profiler.py | 1772 | |
| LOW | scalene/scalene_utility.py | 543 | |
| LOW | scalene/scalene_utility.py | 625 | |
| LOW | scalene/scalene_signal_manager.py | 318 | |
| LOW | scalene/scalene_parseargs.py | 199 | |
| LOW | scalene/scalene_parseargs.py | 585 | |
| LOW | scalene/scalene_tensorflow.py | 47 | |
| LOW | scalene/scalene_torch.py | 185 | |
| LOW | scalene/scalene_tracing.py | 131 | |
| LOW | scalene/scalene_json.py | 708 | |
| LOW | scalene/scalene_output.py | 277 | |
| LOW | scalene/scalene_statistics.py | 907 | |
| LOW | scalene/scalene_neuron.py | 125 | |
| LOW | scalene/scalene_cpu_profiler.py | 49 | |
| LOW | scalene/merge_scalene_neuron_profiles.py | 9 | |
| LOW | scalene/merge_scalene_neuron_profiles.py | 96 | |
| LOW | scalene/scalene_library_profiler.py | 163 | |
| LOW | scalene/scalene_analysis.py | 18 | |
| LOW | scalene/scalene_analysis.py | 69 | |
| LOW | scalene/scalene_analysis.py | 101 | |
| LOW | scalene/scalene_analysis.py | 136 | |
| LOW | scalene/scalene_analysis.py | 168 | |
| LOW | scalene/scalene_analysis.py | 175 | |
| LOW | scalene/scalene_nvidia_gpu.py | 112 | |
| LOW | benchmarks/new_benchmark.py | 42 | |
| LOW | benchmarks/pystone.py | 198 | |
| LOW | benchmarks/measure_profiler_memory.py | 42 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | test/original/bm_raytrace.py | 0 | this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f |
| HIGH | test/optimized/bm_raytrace.py | 0 | this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f |
| HIGH | test/expensive_benchmarks/bm_raytrace.py | 0 | this file contains definitions for a simple raytracer. copyright callum and tony garnock-jones, 2008. this file may be f |
| HIGH | test/automatic/svm/svm-original.py | 0 | compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th |
| HIGH | test/automatic/svm/svm-optimized.py | 0 | compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th |
| HIGH | test/automatic/svm/svm-optimized.py | 0 | compute the subgradient of the objective function. arguments: wb (ndarray, shape = (n_features+1,)): concatenation of th |
| Severity | File | Line | Snippet |
|---|---|---|---|
| CRITICAL | scalene/scalene-gui/jquery-3.6.0.slim.min.js | 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):f |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | setup.py | 291 | # so it seems best to just use them and let it error out if not recognized. |
| LOW | tests/test_coverup_66.py | 39 | # Mock webbrowser.get().open to simply return True |
| MEDIUM | scalene/scalene-gui/package-lock.json | 2585 | "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", |
| MEDIUM | src/include/traceconfig.hpp | 99 | // installed ``scalene.__file__``). This is the robust check: it |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | test/original/bm_pyflate.py | 236 | |
| MEDIUM | test/optimized/bm_scimark.py | 20 | |
| MEDIUM | test/optimized/bm_scimark.py | 22 | |
| MEDIUM | test/optimized/bm_pyflate.py | 237 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | scalene/scalene_parseargs.py | 164 | Load and parse a YAML configuration file. Args: config_path: Path to the YAML config file |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_coverup_55.py | 20 | def my_method(self): |
| LOW | tests/test_coverup_16.py | 12 | def my_method(self): |
| LOW | scalene/scalene-gui/scalene-gui.ts | 3046 | function doSomething(e: ProgressEvent<FileReader>): void { |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | scalene/scalene_tensorflow.py | 10 | This is a basic implementation that captures overall timing. |
| MEDIUM | scalene/scalene_jax.py | 10 | This is a basic implementation that captures overall timing. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_coverup_66.py | 58 | # we don't have direct access to the variable name. We need to check if the directory |