<commit_before># - Run cppcheck on c++ source files as a custom target and a test
#
#  include(CppcheckTargets)
#  add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR]
#                             [FAIL_ON_WARNINGS]) -
#    Create a target to check a target's sources with cppcheck and the
#    indicated options
#
# Requires these CMake modules:
#  Findcppcheck
#
# Accepts the following input variables:
# * CPPCHECK_EXTRA_ARGS for additional command line parameters to cppcheck
#
# Original Author:
# 2009-2010 <NAME> <<EMAIL>> <<EMAIL>>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

if(TARGET ${PROJECT_NAME}-cppcheck)
  return()
endif()

include(CMakeParseArguments)

if(NOT CPPCHECK_EXECUTABLE)
  find_package(cppcheck 1.66 QUIET)
endif()

if(NOT CPPCHECK_EXECUTABLE)
  add_custom_target(${PROJECT_NAME}-cppcheck
    COMMENT "cppcheck executable not found")
  set_target_properties(${PROJECT_NAME}-cppcheck PROPERTIES
    EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cppcheck)
endif()

if(NOT TARGET cppcheck)
  add_custom_target(cppcheck)
  set_target_properties(cppcheck PROPERTIES
    EXCLUDE_FROM_DEFAULT_BUILD ON)
endif()

function(add_cppcheck _name _files)
  if(NOT CPPCHECK_EXECUTABLE)
    return()
  endif()

  if(CPPCHECK_IGNORED_PATHS)
    string(REPLACE " " " -i" _ignored_paths ${CPPCHECK_IGNORED_PATHS})
    set(CPPCHECK_IGNORED_PATHS -i${_ignored_paths})
  endif()

  set(_cppcheck_args ${CPPCHECK_IGNORED_PATHS} --error-exitcode=2<commit_msg>Use cppcheck only if found wrt requested version<commit_after># - Run cppcheck on c++ source files as a custom target and a test
#
#  include(CppcheckTargets)
#  add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR]
#                             [FAIL_ON_WARNINGS]) -
#    Create a target to check a target's sources with cppcheck and the
#    indicated options
#
# Requires these CMake modules:
#  Findcppcheck
#
# Accepts the following input variables:
# * CPPCHECK_EXTRA_ARGS for additional command line parameters to cppcheck
#
# Original Author:
# 2009-2010 <NAME> <<EMAIL>> <<EMAIL>>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

if(TARGET ${PROJECT_NAME}-cppcheck)
  return()
endif()

include(CMakeParseArguments)

if(NOT CPPCHECK_FOUND)
  find_package(cppcheck 1.66 QUIET)
endif()

if(NOT CPPCHECK_FOUND)
  add_custom_target(${PROJECT_NAME}-cppcheck
    COMMENT "cppcheck executable not found")
  set_target_properties(${PROJECT_NAME}-cppcheck PROPERTIES
    EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cppcheck)
endif()

if(NOT TARGET cppcheck)
  add_custom_target(cppcheck)
  set_target_properties(cppcheck PROPERTIES
    EXCLUDE_FROM_DEFAULT_BUILD ON)
endif()

function(add_cppcheck _name _files)
  if(NOT CPPCHECK_FOUND)
    return()
  endif()

  if(CPPCHECK_IGNORED_PATHS)
    string(REPLACE " " " -i" _ignored_paths ${CPPCHECK_IGNORED_PATHS})
    set(CPPCHECK_IGNORED_PATHS -i${_ignored_paths})
  endif()

  set(_cppcheck_args ${CPPCHECK_IGNORED_PATHS} --error-exitcode=2
{'fraction_non_alphanumeric': 0.096, 'fraction_numerical': 0.014857142857142857, 'mean_word_length': 4.99486301369863, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1163336', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1184, 'n_words': 284}