Metrics:
Total lines of code: 331
Total lines skipped (#nosec): 0

assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/ComfyUI-Loopchain/nodes/storages.py
Line number: 59
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
55	    RETURN_NAMES = ("IMAGE", "LOOP IDX (INT)", "IDX_IN_BATCH (INT)")
56	
57	    def execute(self, key, batch_size, loop_idx, opt_pipeline=None):
58	        key = key.strip()
59	        assert GLOBAL_IMAGE_STORAGE[key], f"Image storage {key} doesn't exist."
60	        dataloader = DataLoader(torch.cat(GLOBAL_IMAGE_STORAGE[key], dim=0), batch_size=batch_size)
61	        return (list(dataloader)[loop_idx], loop_idx, loop_idx % batch_size)
62	    
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/ComfyUI-Loopchain/nodes/storages.py
Line number: 124
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
120	        folder = os.path.join(folder_paths.get_input_directory(), folder)
121	        images = filter(lambda f: os.path.splitext(f)[1] in IMAGE_EXTENSIONS, os.listdir(folder))
122	        images = sorted(list(images))
123	
124	        assert len(images), "No image is found in folder {folder}"
125	
126	        GLOBAL_IMAGE_STORAGE[key] = []
127	
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/ComfyUI-Loopchain/nodes/storages.py
Line number: 198
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
194	    RETURN_NAMES = ("LATENT", "LOOP IDX (INT)", "IDX_IN_BATCH (INT)")
195	
196	    def execute(self, key, batch_size, loop_idx, opt_pipeline=None):
197	        key = key.strip()
198	        assert GLOBAL_LATENT_STORAGE[key], f"Latent storage {key} doesn't exist."
199	        dataloader = DataLoader(torch.cat(GLOBAL_LATENT_STORAGE[key], dim=0), batch_size=batch_size)
200	        return (list(dataloader)[loop_idx], loop_idx, loop_idx % batch_size)
201