diff --git a/compliance-agent/src/classify/language.rs b/compliance-agent/src/classify/language.rs index ac2cf63..332427c 100644 --- a/compliance-agent/src/classify/language.rs +++ b/compliance-agent/src/classify/language.rs @@ -471,11 +471,15 @@ impl HeuristicClassifier { facts_lang("iec-61131-3"), )); } - // A CODESYS project (or its archive) committed to the repository. + // A CODESYS project (or its archive) committed to the repository: + // PLC when nothing else is there. Below a backend manifest, so a + // code repository that also keeps a PLC project stays a code + // target (its CODESYS components are collected either way) and + // keeps its code scans. if m.has_ext("projectarchive") || m.has_ext("project") { out.push(verdict( TargetType::PlcSps, - 0.85, + 0.5, "CODESYS project files", facts_lang("iec-61131-3"), )); @@ -908,7 +912,7 @@ mod tests { } #[tokio::test] - async fn a_committed_codesys_archive_is_plc_even_beside_a_backend_manifest() { + async fn a_committed_codesys_archive_is_plc_unless_code_is_beside_it() { let only_archive = classify_tree(|root| { fs::write(root.join("Line.projectarchive"), b"PK").unwrap(); }) @@ -920,7 +924,7 @@ mod tests { fs::write(root.join("package.json"), "{}").unwrap(); }) .await; - assert_eq!(top(&mixed), TargetType::PlcSps); + assert_eq!(top(&mixed), TargetType::BackendService); } #[tokio::test] diff --git a/docs/guide/plc.md b/docs/guide/plc.md index 5a0b8ea..7704eae 100644 --- a/docs/guide/plc.md +++ b/docs/guide/plc.md @@ -134,9 +134,12 @@ my-plc-project/ ::: A `.projectarchive` (or a CODESYS `.project`) in a repository or an uploaded -archive marks it as a PLC project when Prüfwerk detects the type. A repository -created through the managed git source therefore becomes **SPS / PLC** on its -first scan, and later scans run the control-logic analysis. Whatever the +archive marks it as a PLC project when Prüfwerk detects the type and the +repository holds no application code with a build manifest. A repository +created through the managed git source with only a CODESYS project therefore +becomes **SPS / PLC** on its first scan, and later scans run the control-logic +analysis; one that also holds, say, a `package.json` or `pom.xml` stays a code +target. Whatever the target's type, the library + runtime SBOM and its CVEs come from every `.projectarchive` the code holds, so a target kept as **Backend / API** still lists its CODESYS components.