Open AppChecker opened 8 years ago
Good afternoon!
We've checked your source code with AppChecker static analyzer and found some possible defects:
1) Microsoft.Research/MetadataContracts/MetadataTracker.cs
if (lineText.Contains('(') && lineText.Contains('(') && lineText.Contains(';')) { //If method
Presence of symbol '(' is cheching twice. I guess it should be ')' second time
2) Microsoft.Research/ContractAdornments/CSharp.Roslyn/Inheritance/InheritanceTracker.cs#L233
if (!(@this._propertyKeys.Contains(tuple.Item1) && @this._propertyKeys.Contains(tuple.Item1)))
@this._propertyKeys.Contains(tuple.Item1) is checking twice. Maybe, tuple.Item2 should be checked
@this._propertyKeys.Contains(tuple.Item1)
tuple.Item2
Same defect seems to be here - https://github.com/Microsoft/CodeContracts/blob/01e007bc7b2fbd11eb1418ed10d1e0d595195046/Microsoft.Research/ContractAdornments/CSharp/Inheritance/InheritanceTracker.cs#L233
3) System.Compiler/Reader.cs#L3968
if (modified == null || modified == null) return null;
modified is checking twice. Maybe, modifier must be checked instead
modified
modifier
4) System.Compiler/Reader.cs#L2442
if ((((MethodFlags)meth.Flags) & MethodFlags.SpecialName) != 0 && (((MethodFlags)meth.Flags) & MethodFlags.SpecialName) != 0)
(((MethodFlags)meth.Flags) & MethodFlags.SpecialName) != 0 is checking twice
(((MethodFlags)meth.Flags) & MethodFlags.SpecialName) != 0
5) Microsoft.Research/ContractAdornments/CSharp.Roslyn/Contracts/ContractsProvider.cs#L714
if (semanticType.Name == null || semanticType.Name == null) goto ReturnFalse;
semanticType.Name is checking twice
semanticType.Name
Same defect seems to be here - https://github.com/Microsoft/CodeContracts/blob/01e007bc7b2fbd11eb1418ed10d1e0d595195046/Microsoft.Research/ContractAdornments/CSharp.Roslyn/Contracts/ContractsProvider.cs#L694
6) Microsoft.VisualStudio.CodeTools/TaskManager/Tool.cs#L128
if (buildTask != null && buildTask != null)
buildTask != null is checking twice
buildTask != null
All possible defects were found by Echelon team with AppChecker static analyzer.
Thanks a lot. They're definitely bugs!
Good afternoon!
We've checked your source code with AppChecker static analyzer and found some possible defects:
1) Microsoft.Research/MetadataContracts/MetadataTracker.cs
if (lineText.Contains('(') && lineText.Contains('(') && lineText.Contains(';')) { //If method
Presence of symbol '(' is cheching twice. I guess it should be ')' second time
2) Microsoft.Research/ContractAdornments/CSharp.Roslyn/Inheritance/InheritanceTracker.cs#L233
if (!(@this._propertyKeys.Contains(tuple.Item1) && @this._propertyKeys.Contains(tuple.Item1)))
@this._propertyKeys.Contains(tuple.Item1)
is checking twice. Maybe,tuple.Item2
should be checkedSame defect seems to be here - https://github.com/Microsoft/CodeContracts/blob/01e007bc7b2fbd11eb1418ed10d1e0d595195046/Microsoft.Research/ContractAdornments/CSharp/Inheritance/InheritanceTracker.cs#L233
3) System.Compiler/Reader.cs#L3968
if (modified == null || modified == null) return null;
modified
is checking twice. Maybe,modifier
must be checked instead4) System.Compiler/Reader.cs#L2442
(((MethodFlags)meth.Flags) & MethodFlags.SpecialName) != 0
is checking twice5) Microsoft.Research/ContractAdornments/CSharp.Roslyn/Contracts/ContractsProvider.cs#L714
if (semanticType.Name == null || semanticType.Name == null) goto ReturnFalse;
semanticType.Name
is checking twiceSame defect seems to be here - https://github.com/Microsoft/CodeContracts/blob/01e007bc7b2fbd11eb1418ed10d1e0d595195046/Microsoft.Research/ContractAdornments/CSharp.Roslyn/Contracts/ContractsProvider.cs#L694
6) Microsoft.VisualStudio.CodeTools/TaskManager/Tool.cs#L128
if (buildTask != null && buildTask != null)
buildTask != null
is checking twiceAll possible defects were found by Echelon team with AppChecker static analyzer.