ScanCode 분석 방법

1 기본 사용법[ | ]

프로그램 사용법 확인
./scancode --help
→ 단, Windows는 ./scancode 대신 scancode 로 수행함
커맨드 라인에 샘플 결과 출력
./scancode --examples
Samples 폴더 또는 파일을 분석 후 samples.html로 출력
./scancode Samples --html-app samples.html

2 분석 수행[ | ]

  • 분석할 <INPUT> 파일 또는 디렉토리 위치를 적고, 분석된 결과를 저장할 결과 <포멧 옵션+ 출력파일 위치>를 넣음
./scancode [OPTIONS] <INPUT> <OUTPUT FORMAT OPTION(s)>
  • 주요 OPTIONS
Primary scans
  primary scans:
    -l, --license      <input> 라이선스 텍스트 정보 스캔
    -p, --package   <input> 패키지 명시된 정보 스캔
    -c, --copyright  <input> copyrights 정보 스캔
Other scans
  other scans:
    -i, --info    <input> 파일의 정보 스캔 (size, checksums, etc).
    -e, --email  <input> 이메일 정보 스캔 (라이선스 저작권자 확인에 사용됨)
    -u, --url     <input> url 정보 스캔 (코드 다운로드 위치 확인에 사용됨)
  • 주요 OPTIONS 예제
모든 정보 스캔하기
[root@zetawiki ~]# ./scancode -c -l -i -p -e -u ../Test --html-app Test.html
Setup plugins...
Collect file inventory...
Scan files for: info, licenses, copyrights, packages, emails, urls with 1 process(es)...
[--#-----------------] 671 Scanned: Test.c
Errors count:   0
Scan Speed:     2.39 files/sec. 47.67 KB/sec.
Initial counts: 463 resource(s): 438 file(s) and 25 directorie(s)
Final counts:   463 resource(s): 438 file(s) and 25 directorie(s) for 8.52 MB
Timings:
  setup_scan:licenses: 2.57s
  setup: 2.57s
  inventory: 0.10s
  scan: 183.07s
  post-scan:package-root: 0.32s
  post-scan: 0.32s
  output:html-app: 0.56s
  output: 0.56s
  total: 186.65s
[root@zetawiki ~]# vim Test.html
Scan option
  scan options:
    --license-diag               Include diagnostic information in license scan results.
    --license-expression         Report detected licenses as license expressions.
    --license-score INTEGER      Do not return license matches with a score lower than this score. 
                                         A number between 0 and 100.  [default: 0]
    --license-text               Include the detected licenses matched text.
    --license-url-template TEXT  Set the template URL used for the license reference URLs. 
                                         Curly braces ({}) are replaced by the license key.  
                                         [default: https://enterprise.dejacode.com/urn/urn:dje:license:{}]
    --max-email INT              Report only up to INT emails found in a file.
                                       Use 0 for no limit.  [default: 50]
    --max-url INT                Report only up to INT urls found in a file. 
                                      Use 0 for no limit.  [default: 50]
  • 주요 OUTPUT FORMAT OPTION(s)
Output formats
  output formats:
    --json FILE             Write scan output as compact JSON to FILE.
    --json-pp FILE          Write scan output as pretty-printed JSON to FILE.
    --json-lines FILE       Write scan output as JSON Lines to FILE.
    --csv FILE              Write scan output as CSV to FILE.
    --html FILE             Write scan output as HTML to FILE.
    --custom-output FILE    Write scan output to FILE formatted with the custom Jinja template file.
    --custom-template FILE  Use this Jinja template FILE as a custom template.
    --html-app FILE         Write scan output as a mini HTML application to FILE.
    --spdx-rdf FILE         Write scan output as SPDX RDF to FILE.
    --spdx-tv FILE          Write scan output as SPDX Tag/Value to FILE.
Output filters
  output filters:
    --ignore-author <pattern>       Ignore findings with an author matching <pattern>. 
                                             Note that this will ignore a file even if it has other scanned data 
                                             such as a license or errors.
    --ignore-copyright-holder <pattern>
                                    Ignore findings with a copyright holder matching <pattern>. 
                                    Note that this will ignore a file even if it has other scanned
                                    data such as a license or errors.
    --only-findings                 Only return files or directories with findings for the requested scans. 
                                        Files and directories without findings are omitted
                                    (file information is not treated as findings).
Output control
  output control:
    --full-root   Report full, absolute paths. The default is to always include the last directory segment of 
                    the scanned path such that all paths have a common root directory.
    --strip-root  Strip the root directory segment of all paths. The default is to always include the last directory 
                     segment of the scanned path such that all paths have a common root directory.

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}