Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add typing to Worker module

Open
#37 0 comments 1 reaction 2 assignees View on GitHub

@JuanTecedor is already working on this.

Since Jun 20, 2026.

  • #38 by @JuanTecedor — open

Assessment

This issue has not been assessed yet.

Description

enhancement

Currently, all cortexutils is missing typing, but we should start with the worker module as it is the root of the inheritance.

This makes writing analyzers with any static type checker very tedious.

One example of a noisy/hard function to type is any that uses error with conditional branching:

from cortexutils.analyzer import Analyzer

class ExampleAnalyzer(Analyzer):
    ...

    def preprocess_url(self, url: str) -> str:
        if not url.startswith("http"):
            self.error(f"Invalid URL: {url}")
        else:
            processed_url = url.lower()
            return processed_url
cortexutils/example.py:5: error: Missing return statement  [return]
Found 1 error in 1 file (checked 6 source files)

Current workaround is to add # type: ignore[return], which is not ideal as it invalidates most of the type safety.

Dominant language
Python
Stars
8
Forks
18
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TheHive-Project/cortexutils

All issues in TheHive-Project/cortexutils

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.