[INFO] cloning repository https://github.com/Groww-OSS/hela [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Groww-OSS/hela" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FGroww-OSS%2Fhela", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FGroww-OSS%2Fhela'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] f5663b867f5fb3b46a055a0c98ed62e47fac2c43 [INFO] linting Groww-OSS/hela against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FGroww-OSS%2Fhela" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Groww-OSS/hela [INFO] finished tweaking git repo https://github.com/Groww-OSS/hela [INFO] tweaked toml for git repo https://github.com/Groww-OSS/hela written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Groww-OSS/hela on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/Groww-OSS/hela already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded bson v2.13.0 [INFO] [stderr] Downloaded security-framework-sys v2.13.0 [INFO] [stderr] Downloaded mongodb v2.8.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 75c5d085f99d63fe4be750ef989c9f3361a7fe9e41e68ce51ae2f0b8f957b415 [INFO] running `Command { std: "docker" "start" "-a" "75c5d085f99d63fe4be750ef989c9f3361a7fe9e41e68ce51ae2f0b8f957b415", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "75c5d085f99d63fe4be750ef989c9f3361a7fe9e41e68ce51ae2f0b8f957b415", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "75c5d085f99d63fe4be750ef989c9f3361a7fe9e41e68ce51ae2f0b8f957b415", kill_on_drop: false }` [INFO] [stdout] 75c5d085f99d63fe4be750ef989c9f3361a7fe9e41e68ce51ae2f0b8f957b415 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 5c014c2b662a8893ac486646205dc393c454fef40c4c26add78e53f6fa129df8 [INFO] running `Command { std: "docker" "start" "-a" "5c014c2b662a8893ac486646205dc393c454fef40c4c26add78e53f6fa129df8", kill_on_drop: false }` [INFO] [stderr] Compiling cc v1.2.6 [INFO] [stderr] Compiling tokio-macros v2.4.0 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Compiling strsim v0.10.0 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking unicode-normalization v0.1.24 [INFO] [stderr] Compiling serde_json v1.0.134 [INFO] [stderr] Checking icu_normalizer v1.5.0 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking match_cfg v0.1.0 [INFO] [stderr] Checking semver-parser v0.7.0 [INFO] [stderr] Compiling unicase v2.8.1 [INFO] [stderr] Checking ipnet v2.10.1 [INFO] [stderr] Checking matches v0.1.10 [INFO] [stderr] Checking hostname v0.3.1 [INFO] [stderr] Checking semver v0.9.0 [INFO] [stderr] Compiling time-macros v0.2.19 [INFO] [stderr] Compiling rustc_version_runtime v0.2.1 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Compiling async-trait v0.1.83 [INFO] [stderr] Checking data-encoding v2.6.0 [INFO] [stderr] Checking linked-hash-map v0.5.6 [INFO] [stderr] Checking resolv-conf v0.7.0 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking dirs-next v2.0.0 [INFO] [stderr] Checking rustc_version v0.2.3 [INFO] [stderr] Checking serde_bytes v0.11.15 [INFO] [stderr] Checking lru-cache v0.1.2 [INFO] [stderr] Checking uuid v1.11.0 [INFO] [stderr] Checking idna v0.2.3 [INFO] [stderr] Checking csv-core v0.1.11 [INFO] [stderr] Checking webpki-roots v0.25.4 [INFO] [stderr] Checking base64 v0.13.1 [INFO] [stderr] Checking idna_adapter v1.2.0 [INFO] [stderr] Checking tokio v1.42.0 [INFO] [stderr] Checking stringprep v0.1.5 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking ahash v0.8.11 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking chrono v0.4.39 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking term v0.7.0 [INFO] [stderr] Checking sha2 v0.10.8 [INFO] [stderr] Checking pbkdf2 v0.11.0 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking csv v1.3.1 [INFO] [stderr] Checking sha-1 v0.10.1 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking md-5 v0.10.6 [INFO] [stderr] Checking block-buffer v0.9.0 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking is-terminal v0.4.13 [INFO] [stderr] Checking socket2 v0.4.10 [INFO] [stderr] Checking unsafe-libyaml v0.2.11 [INFO] [stderr] Checking encode_unicode v1.0.0 [INFO] [stderr] Checking take_mut v0.2.2 [INFO] [stderr] Checking sha2 v0.9.9 [INFO] [stderr] Checking argparse v0.2.2 [INFO] [stderr] Checking time v0.3.37 [INFO] [stderr] Compiling ring v0.17.8 [INFO] [stderr] Compiling openssl-sys v0.9.104 [INFO] [stderr] Checking prettytable-rs v0.10.0 [INFO] [stderr] Compiling openssl v0.10.68 [INFO] [stderr] Compiling native-tls v0.2.12 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking bson v2.13.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Compiling darling_core v0.13.4 [INFO] [stderr] Compiling enum-as-inner v0.4.0 [INFO] [stderr] Compiling typed-builder v0.10.0 [INFO] [stderr] Compiling derivative v2.2.0 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking tokio-util v0.7.13 [INFO] [stderr] Checking trust-dns-proto v0.21.2 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Compiling darling_macro v0.13.4 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Compiling darling v0.13.4 [INFO] [stderr] Compiling serde_with_macros v1.5.2 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking trust-dns-resolver v0.21.2 [INFO] [stderr] Checking serde_with v1.14.0 [INFO] [stderr] Checking mongodb v2.8.2 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking Hela v0.1.4 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `core::time` [INFO] [stdout] --> src/utils/pipeline.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::time; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::time` [INFO] [stdout] --> src/utils/pipeline.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::time; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/utils/pipeline.rs:278:21 [INFO] [stdout] | [INFO] [stdout] 278 | let mut sca_count = 0; [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/utils/pipeline.rs:278:21 [INFO] [stdout] | [INFO] [stdout] 278 | let mut sca_count = 0; [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `sca_count` [INFO] [stdout] --> src/utils/pipeline.rs:278:21 [INFO] [stdout] | [INFO] [stdout] 278 | let mut sca_count = 0; [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sca_count` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `found_sca_issues` is assigned to, but never used [INFO] [stdout] --> src/utils/pipeline.rs:326:21 [INFO] [stdout] | [INFO] [stdout] 326 | let mut found_sca_issues = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_found_sca_issues` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `secret_count` [INFO] [stdout] --> src/utils/pipeline.rs:430:13 [INFO] [stdout] | [INFO] [stdout] 430 | let secret_count = 0; [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_secret_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_sca_issues` is never read [INFO] [stdout] --> src/utils/pipeline.rs:333:25 [INFO] [stdout] | [INFO] [stdout] 333 | found_sca_issues = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `policy_yaml` is never read [INFO] [stdout] --> src/utils/pipeline.rs:811:50 [INFO] [stdout] | [INFO] [stdout] 811 | let mut policy_yaml: serde_yaml::Value = serde_yaml::Value::Null; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `sca_count` [INFO] [stdout] --> src/utils/pipeline.rs:278:21 [INFO] [stdout] | [INFO] [stdout] 278 | let mut sca_count = 0; [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sca_count` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `found_sca_issues` is assigned to, but never used [INFO] [stdout] --> src/utils/pipeline.rs:326:21 [INFO] [stdout] | [INFO] [stdout] 326 | let mut found_sca_issues = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_found_sca_issues` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `secret_count` [INFO] [stdout] --> src/utils/pipeline.rs:430:13 [INFO] [stdout] | [INFO] [stdout] 430 | let secret_count = 0; [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_secret_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_sca_issues` is never read [INFO] [stdout] --> src/utils/pipeline.rs:333:25 [INFO] [stdout] | [INFO] [stdout] 333 | found_sca_issues = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `policy_yaml` is never read [INFO] [stdout] --> src/utils/pipeline.rs:811:50 [INFO] [stdout] | [INFO] [stdout] 811 | let mut policy_yaml: serde_yaml::Value = serde_yaml::Value::Null; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `host` [INFO] [stdout] --> src/utils/pipeline.rs:1316:9 [INFO] [stdout] | [INFO] [stdout] 1316 | let host = repo_url.host_str().unwrap_or("github.com"); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_host` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:65:25 [INFO] [stdout] | [INFO] [stdout] 65 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/scans/tools/sast_tool.rs:70:16 [INFO] [stdout] | [INFO] [stdout] 70 | if rule_path != "" && rule_path.starts_with("http") { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule_path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:76:37 [INFO] [stdout] | [INFO] [stdout] 76 | let clone_command = format!( [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 77 | | "git clone https://github.com/rohitcodergroww/semgrep-rules /tmp/sast-rules" [INFO] [stdout] 78 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `"git clone https://github.com/rohitcodergroww/semgrep-rules /tmp/sast-rules".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:82:37 [INFO] [stdout] | [INFO] [stdout] 82 | let remove_git_folder = format!("rm -rf /tmp/sast-rules/.github"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"rm -rf /tmp/sast-rules/.github".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sast_tool.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 95 | | excluded_folders.push("node_modules"); [INFO] [stdout] 96 | | excluded_folders.push("build"); [INFO] [stdout] 97 | | excluded_folders.push("bundles"); [INFO] [stdout] ... | [INFO] [stdout] 100 | | excluded_folders.push("__tests__"); [INFO] [stdout] 101 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.map(..)` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:108:14 [INFO] [stdout] | [INFO] [stdout] 108 | .filter_map(|entry| { [INFO] [stdout] | ______________^ [INFO] [stdout] 109 | | // Convert the `DirEntry` to a `PathBuf` [INFO] [stdout] 110 | | let entry = entry.unwrap(); [INFO] [stdout] 111 | | let path = entry.path(); [INFO] [stdout] 112 | | let path = path.to_str().unwrap().to_string(); [INFO] [stdout] 113 | | Some(path) [INFO] [stdout] 114 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/scans/tools/sca_tool.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 31 | / async fn install_project_dependencies( [INFO] [stdout] 32 | | &self, [INFO] [stdout] 33 | | _path: &str, [INFO] [stdout] 34 | | ignore_dirs: Vec<&str>, [INFO] [stdout] ... | [INFO] [stdout] 39 | | verbose: bool, [INFO] [stdout] 40 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if detected_files.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!detected_files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `host` [INFO] [stdout] --> src/utils/pipeline.rs:1316:9 [INFO] [stdout] | [INFO] [stdout] 1316 | let host = repo_url.host_str().unwrap_or("github.com"); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_host` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/scans/tools/sca_tool.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / pub async fn run_scan( [INFO] [stdout] 205 | | &self, [INFO] [stdout] 206 | | _path: &str, [INFO] [stdout] 207 | | _branch: Option<&str>, [INFO] [stdout] ... | [INFO] [stdout] 213 | | verbose: bool, [INFO] [stdout] 214 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/scans/tools/sca_tool.rs:225:12 [INFO] [stdout] | [INFO] [stdout] 225 | if manfiests != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!manfiests.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sca_tool.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | / let mut ignore_dirs = Vec::new(); [INFO] [stdout] 236 | | ignore_dirs.push("node_modules"); [INFO] [stdout] 237 | | ignore_dirs.push("bin"); [INFO] [stdout] 238 | | ignore_dirs.push("venv"); [INFO] [stdout] 239 | | ignore_dirs.push(".venv"); [INFO] [stdout] | |__________________________________^ help: consider using the `vec![]` macro: `let ignore_dirs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sca_tool.rs:259:25 [INFO] [stdout] | [INFO] [stdout] 259 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sca_tool.rs:261:9 [INFO] [stdout] | [INFO] [stdout] 261 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 262 | | excluded_folders.push("node_modules"); [INFO] [stdout] 263 | | excluded_folders.push("build"); [INFO] [stdout] 264 | | excluded_folders.push("bundles"); [INFO] [stdout] ... | [INFO] [stdout] 267 | | excluded_folders.push("__tests__"); [INFO] [stdout] 268 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/scans/tools/sca_tool.rs:272:9 [INFO] [stdout] | [INFO] [stdout] 272 | while let Some(folder) = folders.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for folder in folders` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/scans/tools/sca_tool.rs:292:17 [INFO] [stdout] | [INFO] [stdout] 292 | no_install.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `no_install` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:323:12 [INFO] [stdout] | [INFO] [stdout] 323 | if manifests.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `manifests.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:359:16 [INFO] [stdout] | [INFO] [stdout] 359 | if json_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!json_output.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/secret_tool.rs:43:25 [INFO] [stdout] | [INFO] [stdout] 43 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/secret_tool.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 45 | | excluded_folders.push("node_modules"); [INFO] [stdout] 46 | | excluded_folders.push("build"); [INFO] [stdout] 47 | | excluded_folders.push("bundles"); [INFO] [stdout] 48 | | excluded_folders.push("dist"); [INFO] [stdout] 49 | | excluded_folders.push("__tests__"); [INFO] [stdout] 50 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/scans/tools/secret_tool.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | while let Some(folder) = folders.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for folder in folders` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/scans/tools/secret_tool.rs:73:38 [INFO] [stdout] | [INFO] [stdout] 73 | serde_json::from_str(&line).expect("Error parsing JSON"); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/scans/tools/secret_tool.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | / if result["DetectorName"].as_str().unwrap() == "GITHUB" { [INFO] [stdout] 111 | | if !result["Raw"].as_str().unwrap().starts_with("gh") [INFO] [stdout] 112 | | && !result["Raw"].as_str().unwrap().starts_with("github") [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 110 ~ if result["DetectorName"].as_str().unwrap() == "GITHUB" [INFO] [stdout] 111 ~ && !result["Raw"].as_str().unwrap().starts_with("gh") [INFO] [stdout] 112 | && !result["Raw"].as_str().unwrap().starts_with("github") [INFO] [stdout] 113 | { [INFO] [stdout] 114 | continue; [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/scans/tools/secret_tool.rs:130:53 [INFO] [stdout] | [INFO] [stdout] 130 | if whitelisted_secrets.contains(&raw_value.to_string()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `raw_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/license_tool.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / let mut ignore_dirs = Vec::new(); [INFO] [stdout] 30 | | ignore_dirs.push("node_modules"); [INFO] [stdout] 31 | | ignore_dirs.push("bin"); [INFO] [stdout] 32 | | ignore_dirs.push("venv"); [INFO] [stdout] 33 | | ignore_dirs.push(".venv"); [INFO] [stdout] | |__________________________________^ help: consider using the `vec![]` macro: `let ignore_dirs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:65:25 [INFO] [stdout] | [INFO] [stdout] 65 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/scans/tools/sast_tool.rs:70:16 [INFO] [stdout] | [INFO] [stdout] 70 | if rule_path != "" && rule_path.starts_with("http") { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule_path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:76:37 [INFO] [stdout] | [INFO] [stdout] 76 | let clone_command = format!( [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 77 | | "git clone https://github.com/rohitcodergroww/semgrep-rules /tmp/sast-rules" [INFO] [stdout] 78 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `"git clone https://github.com/rohitcodergroww/semgrep-rules /tmp/sast-rules".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:82:37 [INFO] [stdout] | [INFO] [stdout] 82 | let remove_git_folder = format!("rm -rf /tmp/sast-rules/.github"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"rm -rf /tmp/sast-rules/.github".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sast_tool.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 95 | | excluded_folders.push("node_modules"); [INFO] [stdout] 96 | | excluded_folders.push("build"); [INFO] [stdout] 97 | | excluded_folders.push("bundles"); [INFO] [stdout] ... | [INFO] [stdout] 100 | | excluded_folders.push("__tests__"); [INFO] [stdout] 101 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.map(..)` [INFO] [stdout] --> src/scans/tools/sast_tool.rs:108:14 [INFO] [stdout] | [INFO] [stdout] 108 | .filter_map(|entry| { [INFO] [stdout] | ______________^ [INFO] [stdout] 109 | | // Convert the `DirEntry` to a `PathBuf` [INFO] [stdout] 110 | | let entry = entry.unwrap(); [INFO] [stdout] 111 | | let path = entry.path(); [INFO] [stdout] 112 | | let path = path.to_str().unwrap().to_string(); [INFO] [stdout] 113 | | Some(path) [INFO] [stdout] 114 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:60:32 [INFO] [stdout] | [INFO] [stdout] 60 | let copy_command = format!("mkdir -p /tmp/code"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"mkdir -p /tmp/code".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:66:21 [INFO] [stdout] | [INFO] [stdout] 66 | _path = format!("/tmp/code"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/code".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/scans/tools/license_tool.rs:75:72 [INFO] [stdout] | [INFO] [stdout] 75 | let random_file_name = format!("{}.json", uuid::Uuid::new().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/scans/scanner.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn execute_scan( [INFO] [stdout] 28 | | &self, [INFO] [stdout] 29 | | mongo_uri: &str, [INFO] [stdout] 30 | | scan_type: &str, [INFO] [stdout] ... | [INFO] [stdout] 39 | | verbose: bool, [INFO] [stdout] 40 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/scans/tools/sca_tool.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 31 | / async fn install_project_dependencies( [INFO] [stdout] 32 | | &self, [INFO] [stdout] 33 | | _path: &str, [INFO] [stdout] 34 | | ignore_dirs: Vec<&str>, [INFO] [stdout] ... | [INFO] [stdout] 39 | | verbose: bool, [INFO] [stdout] 40 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/utils/file_utils.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | .map(|x| format!("{}", x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if detected_files.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!detected_files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/file_utils.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | if ignore_dirs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ignore_dirs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/common.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 - let _ = post_json_data(url, serde_json::to_value(payload).unwrap()).await; [INFO] [stdout] 93 - return; [INFO] [stdout] 92 + let _ = post_json_data(url, serde_json::to_value(payload).unwrap()).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/utils/common.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | if let Some(secret) = document.get_str("secret").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(secret)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 119 - if let Some(secret) = document.get_str("secret").ok() { [INFO] [stdout] 119 + if let Ok(secret) = document.get_str("secret") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:140:48 [INFO] [stdout] | [INFO] [stdout] 140 | print_error(&format!("Error: {}", e.to_string()), 101); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/scans/tools/sca_tool.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / pub async fn run_scan( [INFO] [stdout] 205 | | &self, [INFO] [stdout] 206 | | _path: &str, [INFO] [stdout] 207 | | _branch: Option<&str>, [INFO] [stdout] ... | [INFO] [stdout] 213 | | verbose: bool, [INFO] [stdout] 214 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/utils/common.rs:165:5 [INFO] [stdout] | [INFO] [stdout] 164 | let redacted_string = input.replace(secret, "********"); [INFO] [stdout] | -------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 165 | redacted_string [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 164 ~ [INFO] [stdout] 165 ~ input.replace(secret, "********") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/scans/tools/sca_tool.rs:225:12 [INFO] [stdout] | [INFO] [stdout] 225 | if manfiests != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!manfiests.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sca_tool.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | / let mut ignore_dirs = Vec::new(); [INFO] [stdout] 236 | | ignore_dirs.push("node_modules"); [INFO] [stdout] 237 | | ignore_dirs.push("bin"); [INFO] [stdout] 238 | | ignore_dirs.push("venv"); [INFO] [stdout] 239 | | ignore_dirs.push(".venv"); [INFO] [stdout] | |__________________________________^ help: consider using the `vec![]` macro: `let ignore_dirs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/utils/common.rs:195:17 [INFO] [stdout] | [INFO] [stdout] 195 | if let Some(hash) = document.get_str("hash").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(hash)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 195 - if let Some(hash) = document.get_str("hash").ok() { [INFO] [stdout] 195 + if let Ok(hash) = document.get_str("hash") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/sca_tool.rs:259:25 [INFO] [stdout] | [INFO] [stdout] 259 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/sca_tool.rs:261:9 [INFO] [stdout] | [INFO] [stdout] 261 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 262 | | excluded_folders.push("node_modules"); [INFO] [stdout] 263 | | excluded_folders.push("build"); [INFO] [stdout] 264 | | excluded_folders.push("bundles"); [INFO] [stdout] ... | [INFO] [stdout] 267 | | excluded_folders.push("__tests__"); [INFO] [stdout] 268 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utils/common.rs:242:26 [INFO] [stdout] | [INFO] [stdout] 242 | let suppress_error = suppress_error || false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `suppress_error` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/scans/tools/sca_tool.rs:272:9 [INFO] [stdout] | [INFO] [stdout] 272 | while let Some(folder) = folders.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for folder in folders` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/utils/common.rs:245:5 [INFO] [stdout] | [INFO] [stdout] 245 | let output; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `output` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 245 ~ [INFO] [stdout] 246 ~ let output = if command.contains("&&") { [INFO] [stdout] 247 ~ match Command::new("sh").arg("-c").arg(command).output() { [INFO] [stdout] 248 | Ok(output) => output, [INFO] [stdout] ... [INFO] [stdout] 257 | } [INFO] [stdout] 258 ~ } [INFO] [stdout] 259 | } else { [INFO] [stdout] 260 ~ match Command::new(exec_name).args(exec_args).output() { [INFO] [stdout] 261 | Ok(output) => output, [INFO] [stdout] ... [INFO] [stdout] 270 | } [INFO] [stdout] 271 ~ } [INFO] [stdout] 272 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:252:75 [INFO] [stdout] | [INFO] [stdout] 252 | &format!("Error: {} : {}", &command.to_string(), e.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/scans/tools/sca_tool.rs:292:17 [INFO] [stdout] | [INFO] [stdout] 292 | no_install.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `no_install` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:265:75 [INFO] [stdout] | [INFO] [stdout] 265 | &format!("Error: {} : {}", &command.to_string(), e.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/common.rs:278:5 [INFO] [stdout] | [INFO] [stdout] 278 | / if !stderr.is_empty() { [INFO] [stdout] 279 | | if !suppress_error { [INFO] [stdout] 280 | | print_error( [INFO] [stdout] 281 | | format!("{}: {}", "Error executing process: ", stderr).as_str(), [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 278 ~ if !stderr.is_empty() [INFO] [stdout] 279 ~ && !suppress_error { [INFO] [stdout] 280 | print_error( [INFO] [stdout] ... [INFO] [stdout] 283 | ); [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:323:12 [INFO] [stdout] | [INFO] [stdout] 323 | if manifests.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `manifests.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/utils/common.rs:313:29 [INFO] [stdout] | [INFO] [stdout] 313 | if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 313 - if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] 313 + if path.is_dir() && path.file_name().is_some_and(|name| name == ".git") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scans/tools/sca_tool.rs:359:16 [INFO] [stdout] | [INFO] [stdout] 359 | if json_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!json_output.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/utils/common.rs:336:29 [INFO] [stdout] | [INFO] [stdout] 336 | if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 336 - if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] 336 + if path.is_dir() && path.file_name().is_some_and(|name| name == ".git") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:359:38 [INFO] [stdout] | [INFO] [stdout] 359 | Command::new("git").args(&["checkout", base]).output()?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `["checkout", base]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | .args(&["checkout", "-b", "temp_pr_merge_branch", base]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["checkout", "-b", "temp_pr_merge_branch", base]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:368:23 [INFO] [stdout] | [INFO] [stdout] 368 | .args(&["merge", "--no-ff", &format!("origin/{}", pr)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["merge", "--no-ff", &format!("origin/{}", pr)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:377:23 [INFO] [stdout] | [INFO] [stdout] 377 | .args(&["diff", "--name-only", base, "temp_pr_merge_branch"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["diff", "--name-only", base, "temp_pr_merge_branch"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/secret_tool.rs:43:25 [INFO] [stdout] | [INFO] [stdout] 43 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:395:23 [INFO] [stdout] | [INFO] [stdout] 395 | .args(&["ls-tree", "-r", "--name-only", &format!("origin/{}", pr)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["ls-tree", "-r", "--name-only", &format!("origin/{}", pr)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/secret_tool.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / let mut excluded_folders = Vec::new(); [INFO] [stdout] 45 | | excluded_folders.push("node_modules"); [INFO] [stdout] 46 | | excluded_folders.push("build"); [INFO] [stdout] 47 | | excluded_folders.push("bundles"); [INFO] [stdout] 48 | | excluded_folders.push("dist"); [INFO] [stdout] 49 | | excluded_folders.push("__tests__"); [INFO] [stdout] 50 | | excluded_folders.push("test"); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let excluded_folders = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/scans/tools/secret_tool.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | while let Some(folder) = folders.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for folder in folders` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:419:19 [INFO] [stdout] | [INFO] [stdout] 419 | .args(&["show", &format!("origin/{}:{}", pr_branch, file)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["show", &format!("origin/{}:{}", pr_branch, file)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/scans/tools/secret_tool.rs:73:38 [INFO] [stdout] | [INFO] [stdout] 73 | serde_json::from_str(&line).expect("Error parsing JSON"); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:442:15 [INFO] [stdout] | [INFO] [stdout] 442 | .args(&["config", "--global", "user.email", "helabot@example.com"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["config", "--global", "user.email", "helabot@example.com"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:447:15 [INFO] [stdout] | [INFO] [stdout] 447 | .args(&["config", "--global", "user.name", "Hela Bot"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["config", "--global", "user.name", "Hela Bot"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/scans/tools/secret_tool.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | / if result["DetectorName"].as_str().unwrap() == "GITHUB" { [INFO] [stdout] 111 | | if !result["Raw"].as_str().unwrap().starts_with("gh") [INFO] [stdout] 112 | | && !result["Raw"].as_str().unwrap().starts_with("github") [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 110 ~ if result["DetectorName"].as_str().unwrap() == "GITHUB" [INFO] [stdout] 111 ~ && !result["Raw"].as_str().unwrap().starts_with("gh") [INFO] [stdout] 112 | && !result["Raw"].as_str().unwrap().starts_with("github") [INFO] [stdout] 113 | { [INFO] [stdout] 114 | continue; [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:479:19 [INFO] [stdout] | [INFO] [stdout] 479 | .args(&["fetch", "origin", pr]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["fetch", "origin", pr]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/scans/tools/secret_tool.rs:130:53 [INFO] [stdout] | [INFO] [stdout] 130 | if whitelisted_secrets.contains(&raw_value.to_string()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `raw_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:523:15 [INFO] [stdout] | [INFO] [stdout] 523 | .args(&["log", "-p", "--pretty=format:%H", "--", file_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["log", "-p", "--pretty=format:%H", "--", file_path]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/scans/tools/license_tool.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / let mut ignore_dirs = Vec::new(); [INFO] [stdout] 30 | | ignore_dirs.push("node_modules"); [INFO] [stdout] 31 | | ignore_dirs.push("bin"); [INFO] [stdout] 32 | | ignore_dirs.push("venv"); [INFO] [stdout] 33 | | ignore_dirs.push(".venv"); [INFO] [stdout] | |__________________________________^ help: consider using the `vec![]` macro: `let ignore_dirs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:567:63 [INFO] [stdout] | [INFO] [stdout] 567 | format!("Error for request url {}: {}", url, e.to_string()).as_str(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (13/7) [INFO] [stdout] --> src/utils/pipeline.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / pub async fn pipeline_failure( [INFO] [stdout] 14 | | code_path: String, [INFO] [stdout] 15 | | is_sast: bool, [INFO] [stdout] 16 | | is_sca: bool, [INFO] [stdout] ... | [INFO] [stdout] 26 | | engagement_name: String, [INFO] [stdout] 27 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | let mut _path = format!("/tmp/app"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/app".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:60:32 [INFO] [stdout] | [INFO] [stdout] 60 | let copy_command = format!("mkdir -p /tmp/code"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"mkdir -p /tmp/code".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/scans/tools/license_tool.rs:66:21 [INFO] [stdout] | [INFO] [stdout] 66 | _path = format!("/tmp/code"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/tmp/code".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sast_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:880:31 [INFO] [stdout] | [INFO] [stdout] 879 | if is_sast && sast_policy.is_some() { [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] 880 | let sast_policy = sast_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sca_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:967:30 [INFO] [stdout] | [INFO] [stdout] 966 | if is_sca && sca_policy.is_some() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 967 | let sca_policy = sca_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `secret_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:1016:33 [INFO] [stdout] | [INFO] [stdout] 1015 | if is_secret && secret_policy.is_some() { [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] 1016 | let secret_policy = secret_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `license_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:1074:34 [INFO] [stdout] | [INFO] [stdout] 1073 | if is_license_compliance && license_policy.is_some() { [INFO] [stdout] | ------------------------ the check is happening here [INFO] [stdout] 1074 | let license_policy = license_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/scans/tools/license_tool.rs:75:72 [INFO] [stdout] | [INFO] [stdout] 75 | let random_file_name = format!("{}.json", uuid::Uuid::new().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/scans/scanner.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn execute_scan( [INFO] [stdout] 28 | | &self, [INFO] [stdout] 29 | | mongo_uri: &str, [INFO] [stdout] 30 | | scan_type: &str, [INFO] [stdout] ... | [INFO] [stdout] 39 | | verbose: bool, [INFO] [stdout] 40 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/utils/file_utils.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | .map(|x| format!("{}", x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:191:20 [INFO] [stdout] | [INFO] [stdout] 191 | if sca_result["packages"].as_array().unwrap().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sca_result["packages"].as_array().unwrap().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/file_utils.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | if ignore_dirs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ignore_dirs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:234:32 [INFO] [stdout] | [INFO] [stdout] 234 | ... if aliases_array.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!aliases_array.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:264:20 [INFO] [stdout] | [INFO] [stdout] 264 | if vulnerabilities.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!vulnerabilities.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/utils/pipeline.rs:290:39 [INFO] [stdout] | [INFO] [stdout] 290 | let vuln_record = format!( [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 291 | | "\n\nPackage: {}\nSeverity: {}\nSummary: {}\nCWE ID: {}\nAliases: {}", [INFO] [stdout] 292 | | format!("{}@{}", result["package"], result["version"]), [INFO] [stdout] 293 | | result["severity"], [INFO] [stdout] ... | [INFO] [stdout] 296 | | result["aliases"] [INFO] [stdout] 297 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/common.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 - let _ = post_json_data(url, serde_json::to_value(payload).unwrap()).await; [INFO] [stdout] 93 - return; [INFO] [stdout] 92 + let _ = post_json_data(url, serde_json::to_value(payload).unwrap()).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/utils/pipeline.rs:380:31 [INFO] [stdout] | [INFO] [stdout] 380 | let line_number = match result["SourceMetadata"]["Data"]["Filesystem"]["line"].as_i64() [INFO] [stdout] | _______________________________^ [INFO] [stdout] 381 | | { [INFO] [stdout] 382 | | Some(line_number) => line_number, [INFO] [stdout] 383 | | None => 0, [INFO] [stdout] 384 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type i64 and replace your expression with: `result["SourceMetadata"]["Data"]["Filesystem"]["line"].as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/utils/common.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | if let Some(secret) = document.get_str("secret").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(secret)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 119 - if let Some(secret) = document.get_str("secret").ok() { [INFO] [stdout] 119 + if let Ok(secret) = document.get_str("secret") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:420:12 [INFO] [stdout] | [INFO] [stdout] 420 | if secret_results.clone().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!secret_results.clone().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:140:48 [INFO] [stdout] | [INFO] [stdout] 140 | print_error(&format!("Error: {}", e.to_string()), 101); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/utils/common.rs:165:5 [INFO] [stdout] | [INFO] [stdout] 164 | let redacted_string = input.replace(secret, "********"); [INFO] [stdout] | -------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 165 | redacted_string [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 164 ~ [INFO] [stdout] 165 ~ input.replace(secret, "********") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:516:12 [INFO] [stdout] | [INFO] [stdout] 516 | if secret_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!secret_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/utils/common.rs:195:17 [INFO] [stdout] | [INFO] [stdout] 195 | if let Some(hash) = document.get_str("hash").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(hash)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 195 - if let Some(hash) = document.get_str("hash").ok() { [INFO] [stdout] 195 + if let Ok(hash) = document.get_str("hash") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:541:16 [INFO] [stdout] | [INFO] [stdout] 541 | if license_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!license_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utils/common.rs:242:26 [INFO] [stdout] | [INFO] [stdout] 242 | let suppress_error = suppress_error || false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `suppress_error` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/utils/common.rs:245:5 [INFO] [stdout] | [INFO] [stdout] 245 | let output; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `output` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 245 ~ [INFO] [stdout] 246 ~ let output = if command.contains("&&") { [INFO] [stdout] 247 ~ match Command::new("sh").arg("-c").arg(command).output() { [INFO] [stdout] 248 | Ok(output) => output, [INFO] [stdout] ... [INFO] [stdout] 257 | } [INFO] [stdout] 258 ~ } [INFO] [stdout] 259 | } else { [INFO] [stdout] 260 ~ match Command::new(exec_name).args(exec_args).output() { [INFO] [stdout] 261 | Ok(output) => output, [INFO] [stdout] ... [INFO] [stdout] 270 | } [INFO] [stdout] 271 ~ } [INFO] [stdout] 272 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:577:8 [INFO] [stdout] | [INFO] [stdout] 577 | if found_sast_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_sast_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:578:12 [INFO] [stdout] | [INFO] [stdout] 578 | && found_sca_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_sca_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:252:75 [INFO] [stdout] | [INFO] [stdout] 252 | &format!("Error: {} : {}", &command.to_string(), e.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:579:12 [INFO] [stdout] | [INFO] [stdout] 579 | && found_secret_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_secret_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:580:12 [INFO] [stdout] | [INFO] [stdout] 580 | && found_license_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_license_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:265:75 [INFO] [stdout] | [INFO] [stdout] 265 | &format!("Error: {} : {}", &command.to_string(), e.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/pipeline.rs:598:61 [INFO] [stdout] | [INFO] [stdout] 598 | result["extra"]["message"].as_str().unwrap().to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/common.rs:278:5 [INFO] [stdout] | [INFO] [stdout] 278 | / if !stderr.is_empty() { [INFO] [stdout] 279 | | if !suppress_error { [INFO] [stdout] 280 | | print_error( [INFO] [stdout] 281 | | format!("{}: {}", "Error executing process: ", stderr).as_str(), [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 278 ~ if !stderr.is_empty() [INFO] [stdout] 279 ~ && !suppress_error { [INFO] [stdout] 280 | print_error( [INFO] [stdout] ... [INFO] [stdout] 283 | ); [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/utils/pipeline.rs:636:13 [INFO] [stdout] | [INFO] [stdout] 636 | / let mut tags = Vec::new(); [INFO] [stdout] 637 | | tags.push(Value::String( [INFO] [stdout] 638 | | commiter_info["name"].to_string().replace("\"", ""), [INFO] [stdout] 639 | | )); [INFO] [stdout] 640 | | tags.push(Value::String("SAST".to_string())); [INFO] [stdout] | |_________________________________________________________^ help: consider using the `vec![]` macro: `let tags = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/utils/common.rs:313:29 [INFO] [stdout] | [INFO] [stdout] 313 | if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 313 - if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] 313 + if path.is_dir() && path.file_name().is_some_and(|name| name == ".git") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:654:20 [INFO] [stdout] | [INFO] [stdout] 654 | if sca_result["packages"].as_array().unwrap().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sca_result["packages"].as_array().unwrap().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/utils/common.rs:336:29 [INFO] [stdout] | [INFO] [stdout] 336 | if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 336 - if path.is_dir() && path.file_name().map_or(false, |name| name == ".git") { [INFO] [stdout] 336 + if path.is_dir() && path.file_name().is_some_and(|name| name == ".git") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/utils/pipeline.rs:702:25 [INFO] [stdout] | [INFO] [stdout] 702 | / let mut tags = Vec::new(); [INFO] [stdout] 703 | | tags.push(Value::String("SCA".to_string())); [INFO] [stdout] | |____________________________________________________________________^ help: consider using the `vec![]` macro: `let tags = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:359:38 [INFO] [stdout] | [INFO] [stdout] 359 | Command::new("git").args(&["checkout", base]).output()?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `["checkout", base]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | .args(&["checkout", "-b", "temp_pr_merge_branch", base]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["checkout", "-b", "temp_pr_merge_branch", base]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:368:23 [INFO] [stdout] | [INFO] [stdout] 368 | .args(&["merge", "--no-ff", &format!("origin/{}", pr)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["merge", "--no-ff", &format!("origin/{}", pr)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:377:23 [INFO] [stdout] | [INFO] [stdout] 377 | .args(&["diff", "--name-only", base, "temp_pr_merge_branch"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["diff", "--name-only", base, "temp_pr_merge_branch"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:395:23 [INFO] [stdout] | [INFO] [stdout] 395 | .args(&["ls-tree", "-r", "--name-only", &format!("origin/{}", pr)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["ls-tree", "-r", "--name-only", &format!("origin/{}", pr)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:419:19 [INFO] [stdout] | [INFO] [stdout] 419 | .args(&["show", &format!("origin/{}:{}", pr_branch, file)]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["show", &format!("origin/{}:{}", pr_branch, file)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:442:15 [INFO] [stdout] | [INFO] [stdout] 442 | .args(&["config", "--global", "user.email", "helabot@example.com"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["config", "--global", "user.email", "helabot@example.com"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:447:15 [INFO] [stdout] | [INFO] [stdout] 447 | .args(&["config", "--global", "user.name", "Hela Bot"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["config", "--global", "user.name", "Hela Bot"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:885:26 [INFO] [stdout] | [INFO] [stdout] 885 | .get(&serde_yaml::Value::String("operator".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("operator".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:479:19 [INFO] [stdout] | [INFO] [stdout] 479 | .args(&["fetch", "origin", pr]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["fetch", "origin", pr]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:890:26 [INFO] [stdout] | [INFO] [stdout] 890 | .get(&serde_yaml::Value::String("value".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("value".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:912:24 [INFO] [stdout] | [INFO] [stdout] 912 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 913 | | if pipeline_sast_data == &value { [INFO] [stdout] 914 | | is_pipeline_failed = true; [INFO] [stdout] 915 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 920 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 912 ~ } else if operator == "equal_to" [INFO] [stdout] 913 ~ && pipeline_sast_data == &value { [INFO] [stdout] 914 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 918 | ); [INFO] [stdout] 919 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/common.rs:523:15 [INFO] [stdout] | [INFO] [stdout] 523 | .args(&["log", "-p", "--pretty=format:%H", "--", file_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["log", "-p", "--pretty=format:%H", "--", file_path]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:928:9 [INFO] [stdout] | [INFO] [stdout] 928 | / if is_sca && dep_policy.is_some() { [INFO] [stdout] 929 | | if pipline_pkgs_data.len() > 0 { [INFO] [stdout] 930 | | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] 931 | | let dep_policy = policy_json.get("dep").unwrap().as_mapping().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 965 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 928 ~ if is_sca && dep_policy.is_some() [INFO] [stdout] 929 ~ && pipline_pkgs_data.len() > 0 { [INFO] [stdout] 930 | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] ... [INFO] [stdout] 963 | } [INFO] [stdout] 964 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:929:16 [INFO] [stdout] | [INFO] [stdout] 929 | if pipline_pkgs_data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pipline_pkgs_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/utils/pipeline.rs:930:55 [INFO] [stdout] | [INFO] [stdout] 930 | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `policy_json.get("dep").is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:932:48 [INFO] [stdout] | [INFO] [stdout] 932 | if dep_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:934:34 [INFO] [stdout] | [INFO] [stdout] 934 | ... .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:948:20 [INFO] [stdout] | [INFO] [stdout] 948 | if restricted_pkg_contains_list.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!restricted_pkg_contains_list.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/common.rs:567:63 [INFO] [stdout] | [INFO] [stdout] 567 | format!("Error for request url {}: {}", url, e.to_string()).as_str(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:972:26 [INFO] [stdout] | [INFO] [stdout] 972 | .get(&serde_yaml::Value::String("operator".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("operator".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:977:26 [INFO] [stdout] | [INFO] [stdout] 977 | .get(&serde_yaml::Value::String("value".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("value".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (13/7) [INFO] [stdout] --> src/utils/pipeline.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / pub async fn pipeline_failure( [INFO] [stdout] 14 | | code_path: String, [INFO] [stdout] 15 | | is_sast: bool, [INFO] [stdout] 16 | | is_sca: bool, [INFO] [stdout] ... | [INFO] [stdout] 26 | | engagement_name: String, [INFO] [stdout] 27 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:999:24 [INFO] [stdout] | [INFO] [stdout] 999 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1000 | | if pipeline_sca_data == &value { [INFO] [stdout] 1001 | | is_pipeline_failed = true; [INFO] [stdout] 1002 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 1007 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 999 ~ } else if operator == "equal_to" [INFO] [stdout] 1000 ~ && pipeline_sca_data == &value { [INFO] [stdout] 1001 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 1005 | ); [INFO] [stdout] 1006 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1017:43 [INFO] [stdout] | [INFO] [stdout] 1017 | if secret_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1019:26 [INFO] [stdout] | [INFO] [stdout] 1019 | .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sast_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:880:31 [INFO] [stdout] | [INFO] [stdout] 879 | if is_sast && sast_policy.is_some() { [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] 880 | let sast_policy = sast_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sca_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:967:30 [INFO] [stdout] | [INFO] [stdout] 966 | if is_sca && sca_policy.is_some() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 967 | let sca_policy = sca_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `secret_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:1016:33 [INFO] [stdout] | [INFO] [stdout] 1015 | if is_secret && secret_policy.is_some() { [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] 1016 | let secret_policy = secret_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `license_policy` after checking its variant with `is_some` [INFO] [stdout] --> src/utils/pipeline.rs:1074:34 [INFO] [stdout] | [INFO] [stdout] 1073 | if is_license_compliance && license_policy.is_some() { [INFO] [stdout] | ------------------------ the check is happening here [INFO] [stdout] 1074 | let license_policy = license_policy.unwrap().as_mapping().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:1058:24 [INFO] [stdout] | [INFO] [stdout] 1058 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1059 | | if total_secrets_exposed == value { [INFO] [stdout] 1060 | | is_pipeline_failed = true; [INFO] [stdout] 1061 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 1066 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1058 ~ } else if operator == "equal_to" [INFO] [stdout] 1059 ~ && total_secrets_exposed == value { [INFO] [stdout] 1060 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 1064 | ); [INFO] [stdout] 1065 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1075:44 [INFO] [stdout] | [INFO] [stdout] 1075 | if license_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1077:26 [INFO] [stdout] | [INFO] [stdout] 1077 | .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:191:20 [INFO] [stdout] | [INFO] [stdout] 191 | if sca_result["packages"].as_array().unwrap().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sca_result["packages"].as_array().unwrap().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:234:32 [INFO] [stdout] | [INFO] [stdout] 234 | ... if aliases_array.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!aliases_array.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:264:20 [INFO] [stdout] | [INFO] [stdout] 264 | if vulnerabilities.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!vulnerabilities.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/utils/pipeline.rs:290:39 [INFO] [stdout] | [INFO] [stdout] 290 | let vuln_record = format!( [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 291 | | "\n\nPackage: {}\nSeverity: {}\nSummary: {}\nCWE ID: {}\nAliases: {}", [INFO] [stdout] 292 | | format!("{}@{}", result["package"], result["version"]), [INFO] [stdout] 293 | | result["severity"], [INFO] [stdout] ... | [INFO] [stdout] 296 | | result["aliases"] [INFO] [stdout] 297 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/main.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / async fn execute_scan( [INFO] [stdout] 11 | | scan_type: &str, [INFO] [stdout] 12 | | mongo_uri: &str, [INFO] [stdout] 13 | | path: &str, [INFO] [stdout] ... | [INFO] [stdout] 21 | | verbose: bool, [INFO] [stdout] 22 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/utils/pipeline.rs:380:31 [INFO] [stdout] | [INFO] [stdout] 380 | let line_number = match result["SourceMetadata"]["Data"]["Filesystem"]["line"].as_i64() [INFO] [stdout] | _______________________________^ [INFO] [stdout] 381 | | { [INFO] [stdout] 382 | | Some(line_number) => line_number, [INFO] [stdout] 383 | | None => 0, [INFO] [stdout] 384 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type i64 and replace your expression with: `result["SourceMetadata"]["Data"]["Filesystem"]["line"].as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:420:12 [INFO] [stdout] | [INFO] [stdout] 420 | if secret_results.clone().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!secret_results.clone().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/main.rs:180:8 [INFO] [stdout] | [INFO] [stdout] 180 | if mongo_uri != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mongo_uri.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:516:12 [INFO] [stdout] | [INFO] [stdout] 516 | if secret_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!secret_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:541:16 [INFO] [stdout] | [INFO] [stdout] 541 | if license_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!license_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:577:8 [INFO] [stdout] | [INFO] [stdout] 577 | if found_sast_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_sast_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:578:12 [INFO] [stdout] | [INFO] [stdout] 578 | && found_sca_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_sca_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:579:12 [INFO] [stdout] | [INFO] [stdout] 579 | && found_secret_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_secret_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utils/pipeline.rs:580:12 [INFO] [stdout] | [INFO] [stdout] 580 | && found_license_issues == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!found_license_issues` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/utils/pipeline.rs:598:61 [INFO] [stdout] | [INFO] [stdout] 598 | result["extra"]["message"].as_str().unwrap().to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/utils/pipeline.rs:636:13 [INFO] [stdout] | [INFO] [stdout] 636 | / let mut tags = Vec::new(); [INFO] [stdout] 637 | | tags.push(Value::String( [INFO] [stdout] 638 | | commiter_info["name"].to_string().replace("\"", ""), [INFO] [stdout] 639 | | )); [INFO] [stdout] 640 | | tags.push(Value::String("SAST".to_string())); [INFO] [stdout] | |_________________________________________________________^ help: consider using the `vec![]` macro: `let tags = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/sca_tool.rs:230:33 [INFO] [stdout] | [INFO] [stdout] 230 | new_manifests = SUPPORTED_MANIFESTS.to_vec(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/sca_tool.rs:231:40 [INFO] [stdout] | [INFO] [stdout] 231 | new_detect_manifests = DETECT_MANIFESTS.to_vec(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:654:20 [INFO] [stdout] | [INFO] [stdout] 654 | if sca_result["packages"].as_array().unwrap().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sca_result["packages"].as_array().unwrap().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/license_tool.rs:69:53 [INFO] [stdout] | [INFO] [stdout] 69 | find_files_recursively(&_path, unsafe { SUPPORTED_MANIFESTS.to_vec() }, ignore_dirs) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:304:47 [INFO] [stdout] | [INFO] [stdout] 304 | ... result["severity"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/utils/pipeline.rs:702:25 [INFO] [stdout] | [INFO] [stdout] 702 | / let mut tags = Vec::new(); [INFO] [stdout] 703 | | tags.push(Value::String("SCA".to_string())); [INFO] [stdout] | |____________________________________________________________________^ help: consider using the `vec![]` macro: `let tags = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:305:46 [INFO] [stdout] | [INFO] [stdout] 305 | ... result["summary"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:306:45 [INFO] [stdout] | [INFO] [stdout] 306 | ... result["cwe_id"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:307:46 [INFO] [stdout] | [INFO] [stdout] 307 | ... result["aliases"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:885:26 [INFO] [stdout] | [INFO] [stdout] 885 | .get(&serde_yaml::Value::String("operator".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("operator".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:890:26 [INFO] [stdout] | [INFO] [stdout] 890 | .get(&serde_yaml::Value::String("value".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("value".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:912:24 [INFO] [stdout] | [INFO] [stdout] 912 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 913 | | if pipeline_sast_data == &value { [INFO] [stdout] 914 | | is_pipeline_failed = true; [INFO] [stdout] 915 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 920 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 912 ~ } else if operator == "equal_to" [INFO] [stdout] 913 ~ && pipeline_sast_data == &value { [INFO] [stdout] 914 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 918 | ); [INFO] [stdout] 919 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:928:9 [INFO] [stdout] | [INFO] [stdout] 928 | / if is_sca && dep_policy.is_some() { [INFO] [stdout] 929 | | if pipline_pkgs_data.len() > 0 { [INFO] [stdout] 930 | | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] 931 | | let dep_policy = policy_json.get("dep").unwrap().as_mapping().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 965 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 928 ~ if is_sca && dep_policy.is_some() [INFO] [stdout] 929 ~ && pipline_pkgs_data.len() > 0 { [INFO] [stdout] 930 | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] ... [INFO] [stdout] 963 | } [INFO] [stdout] 964 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:929:16 [INFO] [stdout] | [INFO] [stdout] 929 | if pipline_pkgs_data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pipline_pkgs_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/utils/pipeline.rs:930:55 [INFO] [stdout] | [INFO] [stdout] 930 | let restricted_pkg_contains_list = if policy_json.get("dep") != None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `policy_json.get("dep").is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:932:48 [INFO] [stdout] | [INFO] [stdout] 932 | if dep_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:934:34 [INFO] [stdout] | [INFO] [stdout] 934 | ... .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/pipeline.rs:948:20 [INFO] [stdout] | [INFO] [stdout] 948 | if restricted_pkg_contains_list.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!restricted_pkg_contains_list.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:972:26 [INFO] [stdout] | [INFO] [stdout] 972 | .get(&serde_yaml::Value::String("operator".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("operator".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:977:26 [INFO] [stdout] | [INFO] [stdout] 977 | .get(&serde_yaml::Value::String("value".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("value".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:999:24 [INFO] [stdout] | [INFO] [stdout] 999 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1000 | | if pipeline_sca_data == &value { [INFO] [stdout] 1001 | | is_pipeline_failed = true; [INFO] [stdout] 1002 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 1007 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 999 ~ } else if operator == "equal_to" [INFO] [stdout] 1000 ~ && pipeline_sca_data == &value { [INFO] [stdout] 1001 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 1005 | ); [INFO] [stdout] 1006 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1017:43 [INFO] [stdout] | [INFO] [stdout] 1017 | if secret_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1019:26 [INFO] [stdout] | [INFO] [stdout] 1019 | .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/pipeline.rs:1058:24 [INFO] [stdout] | [INFO] [stdout] 1058 | } else if operator == "equal_to" { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1059 | | if total_secrets_exposed == value { [INFO] [stdout] 1060 | | is_pipeline_failed = true; [INFO] [stdout] 1061 | | pipeline_failure_reason = format!( [INFO] [stdout] ... | [INFO] [stdout] 1066 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1058 ~ } else if operator == "equal_to" [INFO] [stdout] 1059 ~ && total_secrets_exposed == value { [INFO] [stdout] 1060 | is_pipeline_failed = true; [INFO] [stdout] ... [INFO] [stdout] 1064 | ); [INFO] [stdout] 1065 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1075:44 [INFO] [stdout] | [INFO] [stdout] 1075 | if license_policy.contains_key(&serde_yaml::Value::String("contains".to_string())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/pipeline.rs:1077:26 [INFO] [stdout] | [INFO] [stdout] 1077 | .get(&serde_yaml::Value::String("contains".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `serde_yaml::Value::String("contains".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/main.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / async fn execute_scan( [INFO] [stdout] 11 | | scan_type: &str, [INFO] [stdout] 12 | | mongo_uri: &str, [INFO] [stdout] 13 | | path: &str, [INFO] [stdout] ... | [INFO] [stdout] 21 | | verbose: bool, [INFO] [stdout] 22 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/main.rs:180:8 [INFO] [stdout] | [INFO] [stdout] 180 | if mongo_uri != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!mongo_uri.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/sca_tool.rs:230:33 [INFO] [stdout] | [INFO] [stdout] 230 | new_manifests = SUPPORTED_MANIFESTS.to_vec(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/sca_tool.rs:231:40 [INFO] [stdout] | [INFO] [stdout] 231 | new_detect_manifests = DETECT_MANIFESTS.to_vec(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/scans/tools/license_tool.rs:69:53 [INFO] [stdout] | [INFO] [stdout] 69 | find_files_recursively(&_path, unsafe { SUPPORTED_MANIFESTS.to_vec() }, ignore_dirs) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:304:47 [INFO] [stdout] | [INFO] [stdout] 304 | ... result["severity"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:305:46 [INFO] [stdout] | [INFO] [stdout] 305 | ... result["summary"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:306:45 [INFO] [stdout] | [INFO] [stdout] 306 | ... result["cwe_id"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/utils/pipeline.rs:307:46 [INFO] [stdout] | [INFO] [stdout] 307 | ... result["aliases"].clone().to_string(), [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 40.65s [INFO] running `Command { std: "docker" "inspect" "5c014c2b662a8893ac486646205dc393c454fef40c4c26add78e53f6fa129df8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5c014c2b662a8893ac486646205dc393c454fef40c4c26add78e53f6fa129df8", kill_on_drop: false }` [INFO] [stdout] 5c014c2b662a8893ac486646205dc393c454fef40c4c26add78e53f6fa129df8