fazibear/codeclimate-credo

Credo analysis failing in Code Climate - 09/06

davehenton opened this issue · 9 comments

  • User is receiving the following error output from the Credo engine:
Unable to find image 'registry.prod.codeclimate.net/codeclimate/codeclimate-credo:b637' locally
b637: Pulling from codeclimate/codeclimate-credo
89d79dde0755: Pulling fs layer
98e0b6763abd: Pulling fs layer
d2826c1b061a: Pulling fs layer
1b461bedfa85: Pulling fs layer
a99cdd190319: Pulling fs layer
5662fc604150: Pulling fs layer
332032d6362d: Pulling fs layer
6a51454f76d6: Pulling fs layer
ae5bce6e6788: Pulling fs layer
d19a37a039e2: Pulling fs layer
f1bcba326819: Pulling fs layer
57adb22f80e2: Pulling fs layer
150661e18ff1: Pulling fs layer
b36596de3627: Pulling fs layer
1b461bedfa85: Waiting
d19a37a039e2: Waiting
a99cdd190319: Waiting
150661e18ff1: Waiting
f1bcba326819: Waiting
b36596de3627: Waiting
5662fc604150: Waiting
ae5bce6e6788: Waiting
6a51454f76d6: Waiting
332032d6362d: Waiting
d2826c1b061a: Download complete
98e0b6763abd: Verifying Checksum
98e0b6763abd: Download complete
89d79dde0755: Verifying Checksum
89d79dde0755: Download complete
1b461bedfa85: Verifying Checksum
1b461bedfa85: Download complete
5662fc604150: Verifying Checksum
5662fc604150: Download complete
89d79dde0755: Pull complete
332032d6362d: Verifying Checksum
332032d6362d: Download complete
a99cdd190319: Verifying Checksum
a99cdd190319: Download complete
6a51454f76d6: Verifying Checksum
6a51454f76d6: Download complete
ae5bce6e6788: Download complete
d19a37a039e2: Verifying Checksum
d19a37a039e2: Download complete
f1bcba326819: Verifying Checksum
f1bcba326819: Download complete
57adb22f80e2: Verifying Checksum
57adb22f80e2: Download complete
98e0b6763abd: Pull complete
150661e18ff1: Verifying Checksum
150661e18ff1: Download complete
d2826c1b061a: Pull complete
b36596de3627: Verifying Checksum
b36596de3627: Download complete
1b461bedfa85: Pull complete
a99cdd190319: Pull complete
5662fc604150: Pull complete
332032d6362d: Pull complete
6a51454f76d6: Pull complete
ae5bce6e6788: Pull complete
d19a37a039e2: Pull complete
f1bcba326819: Pull complete
57adb22f80e2: Pull complete
150661e18ff1: Pull complete
b36596de3627: Pull complete
Digest: sha256:9320d8b62b792d879ad84736e9561271f04dbb4e724f738fd3c108e734848301
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-credo:b637
Error:
%BadStructError{struct: Credo.Execution,
 term: %Credo.ConfigFile{check_for_updates: true,
  checks: [{Credo.Check.Consistency.ParameterPatternMatching, []},
   {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
   {Credo.Check.Readability.PreferImplicitTry, []},
   {Credo.Check.Readability.RedundantBlankLines, []},
   {Credo.Check.Readability.StringSigils, []},
   {Credo.Check.Readability.Semicolons, []},
   {Credo.Check.Readability.SpaceAfterCommas, []},
   {Credo.Check.Refactor.DoubleBooleanNegation, []},
   {Credo.Check.Refactor.LongQuoteBlocks, []},
   {Credo.Check.Warning.LazyLogging, []},
   {Credo.Check.Warning.UnusedFileOperation, []},
   {Credo.Check.Warning.UnusedPathOperation, []},
   {Credo.Check.Warning.UnusedRegexOperation, []},
   {Credo.Check.Warning.RaiseInsideRescue, []},
   {Credo.Check.Refactor.AppendSingleItem, false},
   {Credo.Check.Refactor.VariableRebinding, false},
   {Credo.Check.Warning.MapGetUnsafePass, false},
   {Credo.Check.Consistency.MultiAliasImportRequireUse, false},
   {Credo.Check.Readability.Specs, false},
   {Credo.Check.Consistency.ExceptionNames, []},
   {Credo.Check.Consistency.LineEndings, []},
   {Credo.Check.Consistency.SpaceAroundOperators, []},
   {Credo.Check.Consistency.SpaceInParentheses, []},
   {Credo.Check.Consistency.TabsOrSpaces, []},
   {Credo.Check.Design.AliasUsage, false},
   {Credo.Check.Design.DuplicatedCode, [excluded_macros: []]},
   {Credo.Check.Design.TagTODO, [exit_status: 2]},
   {Credo.Check.Design.TagFIXME, []},
   {Credo.Check.Readability.FunctionNames, []},
   {Credo.Check.Readability.LargeNumbers, []},
   {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 80]},
   {Credo.Check.Readability.ModuleAttributeNames, []},
   {Credo.Check.Readability.ModuleDoc, []},
   {Credo.Check.Readability.ModuleNames, []},
   {Credo.Check.Readability.ParenthesesInCondition, []},
   {Credo.Check.Readability.PredicateFunctionNames, []},
   {Credo.Check.Readability.TrailingBlankLine, []},
   {Credo.Check.Readability.TrailingWhiteSpace, []},
   {Credo.Check.Readability.VariableNames, []},
   {Credo.Check.Refactor.ABCSize, []},
   {Credo.Check.Refactor.CondStatements, []},
   {Credo.Check.Refactor.FunctionArity, []},
   {Credo.Check.Refactor.MatchInCondition, []},
   {Credo.Check.Refactor.PipeChainStart, []},
   {Credo.Check.Refactor.CyclomaticComplexity, []},
   {Credo.Check.Refactor.NegatedConditionsInUnless, ...}, {...}, ...],
  color: false,
  files: %{excluded: [~r/\/_build\//, ~r/\/deps\//],
    included: ["lib/**/*.{ex,exs}", "src/", "web/**/*.{ex,exs}", "apps/"]},
  requires: [], strict: false}}
  • Engine is working when run locally via the CLI
  • Customer is using the default/generated .credo.exs --
    credo.exs.txt

I have another user experiencing this issue, and this is their output on the CLI with the --debug flag added:

[DEBUG] credo:beta engine stderr: Error: 
%BadStructError{struct: Credo.Execution, 
term: %Credo.ConfigFile{check_for_updates: false, 
checks: [{Credo.Check.Consistency.ExceptionNames, []}, 
{Credo.Check.Consistency.LineEndings, []}, 
{Credo.Check.Consistency.MultiAliasImportRequireUse, false}, 
{Credo.Check.Consistency.ParameterPatternMatching, []}, 
{Credo.Check.Consistency.SpaceAroundOperators, []}, 
{Credo.Check.Consistency.SpaceInParentheses, []}, 
{Credo.Check.Consistency.TabsOrSpaces, []}, 
{Credo.Check.Design.AliasUsage, false}, 
{Credo.Check.Design.DuplicatedCode, [excluded_macros: []]}, 
{Credo.Check.Design.TagFIXME, []}, {Credo.Check.Design.TagTODO, []}, 
{Credo.Check.Readability.FunctionNames, []}, 
{Credo.Check.Readability.LargeNumbers, []}, 
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 100]}, 
{Credo.Check.Readability.ModuleAttributeNames, []}, 
{Credo.Check.Readability.ModuleDoc, []}, 
{Credo.Check.Readability.ModuleNames, []}, 
{Credo.Check.Readability.ParenthesesInCondition, []}, 
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, 
{Credo.Check.Readability.PredicateFunctionNames, []}, 
{Credo.Check.Readability.PreferImplicitTry, []}, 
{Credo.Check.Readability.RedundantBlankLines, []}, 
{Credo.Check.Readability.Semicolons, []}, 
{Credo.Check.Readability.SpaceAfterCommas, []}, 
{Credo.Check.Readability.Specs, false}, 
{Credo.Check.Readability.StringSigils, []}, 
{Credo.Check.Readability.TrailingBlankLine, []}, 
{Credo.Check.Readability.TrailingWhiteSpace, []}, 
{Credo.Check.Readability.VariableNames, []}, 
{Credo.Check.Refactor.ABCSize, [max_size: 40]}, 
{Credo.Check.Refactor.AppendSingleItem, []}, 
{Credo.Check.Refactor.CondStatements, []}, 
{Credo.Check.Refactor.CyclomaticComplexity, []}, 
{Credo.Check.Refactor.DoubleBooleanNegation, []}, 
{Credo.Check.Refactor.FunctionArity, []}, 
{Credo.Check.Refactor.LongQuoteBlocks, []}, 
{Credo.Check.Refactor.MatchInCondition, []}, 
{Credo.Check.Refactor.NegatedConditionsInUnless, []}, 
{Credo.Check.Refactor.NegatedConditionsWithElse, []}, 
{Credo.Check.Refactor.Nesting, []}, 
{Credo.Check.Refactor.PipeChainStart, []}, 
{Credo.Check.Refactor.UnlessWithElse, []}, 
{Credo.Check.Refactor.VariableRebinding, []}, 
{Credo.Check.Warning.BoolOperationOnSameValues, []}, 
{Credo.Check.Warning.IExPry, []}, {Credo.Check.Warning.IoInspect, ...}, 
{...}, ...], color: true, 
files: %{excluded: [], 
included: ["config/**/*.{ex,exs}", "lib/**/*.{ex,exs}", 
"priv/**/*.{ex,exs}", "test/**/*.{ex,exs}"]}, requires: [], strict: false}}

Analysis complete! Found 0 issues. 
------------------------------------------------------------

They said said this is inaccurate because there is an issue in the code they've introduced, and running mix credo displays it.

I believe this is a duplicate of #7, see my comment about the source of this error and maybe let's keep the discussion there.

Hi, I guess that the problem was introduced when I'm updated credo to 0.8. Credo has changed some internals. I've made a few changes (on master), but not tested it.

Is codeclimate automatically update containers from master branch?

@fazibear I don't think so, as I saw your Credo update in this repository for quite some time, but the Docker Hub image hasn't been updated until I contacted Code Climate's support.

@davehenton Can you check if updates from PR #9 fixes this problem?

@fazibear looks like #9 is still not merged in

True, because I asked codeclimate team to test it out, and wait for a feedback.

@fazibear Looks good on our end! If you merge that PR, I can deploy it