Skip to content

Add static analysis tools#43

Closed
Nezteb wants to merge 1 commit intosloanelybutsurely:mainfrom
Nezteb:static-analysis-tools
Closed

Add static analysis tools#43
Nezteb wants to merge 1 commit intosloanelybutsurely:mainfrom
Nezteb:static-analysis-tools

Conversation

@Nezteb
Copy link

@Nezteb Nezteb commented Mar 2, 2025

Addresses #19

I also added Dialyzer, which seemed like a simple enough value-add. For some of my own notes on the tool, see: https://fly.io/phoenix-files/adding-dialyzer-without-the-pain/

Output of various commands is below.

Credo:

> mix credo
Checking 10 source files ...

Please report incorrect results: https://github.com/rrrene/credo/issues

Analysis took 0.1 seconds (0.07s to load, 0.09s running 55 checks on 10 files)
96 mods/funs, found no issues.

Showing priority issues: ↑ ↗ →  (use `mix credo explain` to explain issues, `mix credo --help` for options).

Sobelow:

> mix sobelow
WARNING: Sobelow cannot find the router. If this is a Phoenix application
please use the `--router` flag to specify the router's location.

##############################################
#                                            #
#          Running Sobelow - v0.13.0         #
#  Created by Griffin Byatt - @griffinbyatt  #
#     NCC Group - https://nccgroup.trust     #
#                                            #
##############################################

... SCAN COMPLETE ...

Dialyzer:

> mix dialyzer
Finding suitable PLTs
Checking PLT...
[:asn1, :castore, :compiler, :crypto, :decimal, :ecto, :eex, :elixir, :jason, :kernel, :logger, :mime, :phoenix, :phoenix_html, :phoenix_pubsub, :phoenix_template, :plug, :plug_crypto, :public_key, :stdlib, :telemetry, :typeid_elixir, :websock, :websock_adapter]
PLT is up to date!
No :ignore_warnings opt specified in mix.exs and default does not exist.

Starting Dialyzer
[
  check_plt: false,
  init_plt: ~c"/Users/noah/Git/typeid-elixir/_build/dev/dialyxir_erlang-26.0.2_elixir-1.15.0_deps-dev.plt",
  files: [~c"/Users/noah/Git/typeid-elixir/_build/dev/lib/typeid_elixir/ebin/Elixir.Inspect.TypeID.beam",
   ~c"/Users/noah/Git/typeid-elixir/_build/dev/lib/typeid_elixir/ebin/Elixir.Jason.Encoder.TypeID.beam",
   ~c"/Users/noah/Git/typeid-elixir/_build/dev/lib/typeid_elixir/ebin/Elixir.Phoenix.HTML.Safe.TypeID.beam",
   ~c"/Users/noah/Git/typeid-elixir/_build/dev/lib/typeid_elixir/ebin/Elixir.Phoenix.Param.TypeID.beam",
   ~c"/Users/noah/Git/typeid-elixir/_build/dev/lib/typeid_elixir/ebin/Elixir.String.Chars.TypeID.beam",
   ...],
  warnings: [:no_opaque, :unmatched_returns, :error_handling, :unknown, ...]
]
Total errors: 0, Skipped: 0, Unnecessary Skips: 0
done in 0m1.47s
done (passed successfully)

@@ -0,0 +1,13 @@
[
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default file generated by mix sobelow --save-config with a little formatting tweak.

@@ -0,0 +1,217 @@
# This file contains the configuration for Credo and you are probably reading
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default file generated by mix credo gen.config with no alterations on my part.

@Nezteb Nezteb force-pushed the static-analysis-tools branch from c71276a to ce7d4c9 Compare March 2, 2025 19:51
@Nezteb Nezteb closed this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant