<commit_before># import-call-extractor

import-call-extractor is a program for extracing calls to imported packages in a go file

## Install

    go get github.com/freenerd/import-call-extractor

## Use

For basic usage give the absolute go source file path as first argument. In this example, we analyze the code of this package:

    import-call-extractor $GOPATH/src/github.com/freenerd/import-call-extractor/main.go

The output goes to STDOUT and is formated as yaml. It looks like this:

```yaml
flag:
  Parse:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:87:3
  Args:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:88:10
fmt:
  Printf:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:108:3
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:111:4
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:114:5
```
<commit_msg>Readme for packages<commit_after># import-call-extractor

import-call-extractor is a program to analyze go programs. It extracts calls made to imported packages. It can work either on a single go source file or a go package. On a go package, it will also recursively analyze the imported packages.

## Install

    go get github.com/freenerd/import-call-extractor

## Use

For basic usage give the absolute go source file path as first argument. In this example, we analyze the code of this package:

    import-call-extractor $GOPATH/src/github.com/freenerd/import-call-extractor/main.go

The output goes to STDOUT and is formated as yaml. It looks like this:

```yaml
flag:
  Parse:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:87:3
  Args:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:88:10
fmt:
  Printf:
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:108:3
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:111:4
    - /Users/johan/Code/go/src/github.com/freenerd/import-call-extractor/main.go:114:5
```

To analyze a whole package, call like this:

    import call-extractor github.com/freenerd/import-call-extractor

## Limitations

- In package mode, if a package is imported several times, it will be analyzed again
- Calls made in a `var` block will not be extracted

{'fraction_non_alphanumeric': 0.11277569704535996, 'fraction_numerical': 0.01581356637536413, 'mean_word_length': 3.6589147286821704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4950076', 'n_tokens_mistral': 865, 'n_tokens_neox': 820, 'n_words': 208}