diff --git a/license_sh/helpers.py b/license_sh/helpers.py
index 061bde3..3389ef7 100644
--- a/license_sh/helpers.py
+++ b/license_sh/helpers.py
@@ -271,9 +271,9 @@ def filter_dep_tree(tree: AnyNode) -> AnyNode:
     treeCopy = DictImporter().import_(DictExporter().export(tree))
     for node in LevelOrderIter(treeCopy):
         node.children = filter(
-            lambda subnode: hasattr(subnode, "subtree_problem")
-            or hasattr(subnode, "license_problem")
-            or hasattr(subnode, "analyze_problem"),
+            lambda subnode: getattr(subnode, "subtree_problem", False)
+            or getattr(subnode, "license_problem", False)
+            or getattr(subnode, "analyze_problem", False),
             node.children,
         )
 
diff --git a/license_sh/reporters/ConsoleReporter.py b/license_sh/reporters/ConsoleReporter.py
index 5590c6d..3c990a1 100644
--- a/license_sh/reporters/ConsoleReporter.py
+++ b/license_sh/reporters/ConsoleReporter.py
@@ -13,8 +13,8 @@ class ConsoleReporter:
             else:
                 color = (
                     RED
-                    if hasattr(node, "license_problem")
-                    or hasattr(node, "analyze_problem")
+                    if getattr(node, "license_problem", False)
+                    or getattr(node, "analyze_problem", False)
                     else GREEN
                 )
                 normalized_info = (

Filter_dep_tree not working
Filter_dep_tree function only checks for attribute presence and not its value, this makes this function not working on current version of the code and the attributes are always there
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
index 67d2e23..4b32f9c 100644
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -8,6 +8,7 @@ from license_sh.helpers import (
     annotate_dep_tree,
     is_license_ok,
     is_analyze_ok,
+    filter_dep_tree,
     parse_license,
     extract_npm_license,
     get_npm_license_from_licenses_array,
@@ -574,6 +575,22 @@ class NpmRunnerTestCase(unittest.TestCase):
         )
         self.assertEqual(is_analyze_ok(node), False)
 
+    def test_filter_dep_tree_simple(self):
+        tree = AnyNode(children=[AnyNode(subtree_problem=False, license_problem=False)])
+        filtered_tree = filter_dep_tree(tree)
+        self.assertEqual(len(filtered_tree.children), 0)
+
+    def test_filter_dep_tree_multiple(self):
+        tree = AnyNode(
+            children=[
+                AnyNode(id="good", subtree_problem=False, license_problem=False),
+                AnyNode(id="node", subtree_problem=False, license_problem=True),
+            ]
+        )
+        filtered_tree = filter_dep_tree(tree)
+        self.assertEqual(len(filtered_tree.children), 1)
+        self.assertEqual(filtered_tree.children[0].id, "node")
+
 
 if __name__ == "__main__":
     unittest.main()

pip install -e .[dev]
parse_log_pytest
Pipfile
pytest
3.7
Pipfile
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aiohttp==3.8.6
aiosignal==1.3.1
anytree==2.12.1
async-timeout==4.0.3
asynctest==0.13.0
attrs==24.2.0
boolean.py==4.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
docopt==0.6.2
exceptiongroup==1.2.2
frozenlist==1.3.3
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
license-expression==30.2.0
-e git+https://github.com/webscopeio/license.sh.git@8bd48bdc7026768ec5a2c91367b264274d1abaf0#egg=license_sh
multidict==6.0.5
packaging==24.0
pipdeptree==2.9.6
pipfile==0.0.2
pluggy==1.2.0
prompt_toolkit==3.0.48
pytest==7.4.4
questionary==1.10.0
six==1.17.0
termcolor==2.3.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
wcwidth==0.2.13
yarl==1.9.4
yaspin==2.4.0
zipp==3.15.0

name: license.sh
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - pipfile=0.0.2=py_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiohttp==3.8.6
      - aiosignal==1.3.1
      - anytree==2.12.1
      - async-timeout==4.0.3
      - asynctest==0.13.0
      - attrs==24.2.0
      - boolean-py==4.0
      - charset-normalizer==3.4.1
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - frozenlist==1.3.3
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - license-expression==30.2.0
      - multidict==6.0.5
      - packaging==24.0
      - pipdeptree==2.9.6
      - pluggy==1.2.0
      - prompt-toolkit==3.0.48
      - pytest==7.4.4
      - questionary==1.10.0
      - six==1.17.0
      - termcolor==2.3.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - wcwidth==0.2.13
      - yarl==1.9.4
      - yaspin==2.4.0
      - zipp==3.15.0
prefix: /opt/conda/envs/license.sh

tests/test_helpers.py::NpmRunnerTestCase::test_filter_dep_tree_multiple tests/test_helpers.py::NpmRunnerTestCase::test_filter_dep_tree_simple
tests/test_helpers.py::NpmRunnerTestCase::test_annotate_dependency_tree tests/test_helpers.py::NpmRunnerTestCase::test_bad_licenses_identified tests/test_helpers.py::NpmRunnerTestCase::test_bad_licenses_identified__one_package_ignored_by_package_whitelist tests/test_helpers.py::NpmRunnerTestCase::test_bad_licenses_identified_are_ignored_by_package_whitelist tests/test_helpers.py::NpmRunnerTestCase::test_dependency_tree_is_flattened tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_None_data tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_None_version tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_from_versions tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_no_version tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_no_version_license tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_no_versions tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_simple tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_license_version_priority tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_global_empty tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_global_multiple tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_global_single tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_global_single_string tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_specific_version_multiple tests/test_helpers.py::NpmRunnerTestCase::test_extract_npm_licenses_specific_version_simple tests/test_helpers.py::NpmRunnerTestCase::test_get_npm_license_from_licenses_array_None tests/test_helpers.py::NpmRunnerTestCase::test_get_npm_license_from_licenses_empty tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_None2 tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_empty tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_empty2 tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_more_analyzed tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_more_different tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_more_missing tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_more_same tests/test_helpers.py::NpmRunnerTestCase::test_is_analyze_ok_simple tests/test_helpers.py::NpmRunnerTestCase::test_is_license_ok_brackets tests/test_helpers.py::NpmRunnerTestCase::test_is_license_ok_json tests/test_helpers.py::NpmRunnerTestCase::test_is_license_ok_negative tests/test_helpers.py::NpmRunnerTestCase::test_is_license_ok_simple tests/test_helpers.py::NpmRunnerTestCase::test_parse_license_complex tests/test_helpers.py::NpmRunnerTestCase::test_parse_license_simple
license_sh/reporters/ConsoleReporter.py license_sh/helpers.py
license_sh/reporters/ConsoleReporter.py license_sh/helpers.py