Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTaykalo committed Oct 20, 2017
1 parent 194e5e5 commit 2798552
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Unused
`unused.sh` Searches for unused swift functions at specified path

## Usage
```
cd <path-to-the-project>
<path-to-unused.sh>/unused.sh
```

## Generated files
- `raw_functions.txt` - a list of all found (declared) functions
- `filtered_functions.txt`- a list of all found functions filtered by some euristics like (override, @IBAction, testXXX)
- `unique_functions.txt`- unique functions names
- `usage.txt` - functions usage (ATM only functions that appeared once are shown)
- `sorted_usage.txt` - functions sorted by the usage (and name)
- `delete_me.txt` - file that contains information about the function and where it is used

## output
```
Gathering functions
There are 1898 potential functions found
Gathering usage information
There are 32 potential functions to be deleted found
Gathering usage per each of them
It took 197 seconds.
```

## delete_me.txt
This is an example of how outptut can look like
```
---- selectionColor ----
ProjectPath/UIColorExtensions.swift- return UIColor(red: 220.0/255, green: 220.0/255, blue: 220.0/255, alpha: 1)
ProjectPath/UIColorExtensions.swift- }
ProjectPath/UIColorExtensions.swift-
ProjectPath/UIColorExtensions.swift: static func selectionColor() -> UIColor {
ProjectPath/UIColorExtensions.swift- return UIColor(red: 240.0/255, green: 240.0/255, blue: 240.0/255, alpha: 1)
ProjectPath/UIColorExtensions.swift- }
ProjectPath/UIColorExtensions.swift-
```

## Known issues:
- Fully text search (no fancy stuff)
- A lot of false-positives (protocol functions and overrides)
- A lot of false-negatives (text search, yep)

0 comments on commit 2798552

Please sign in to comment.