Giter Site home page Giter Site logo

codecontracts.analyzer's Introduction

Code Contractor

Code Contracts like a charm!

codecontracts.analyzer's People

Contributors

sergeyteplyakov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

codecontracts.analyzer's Issues

More powerfull nullness analysis

Add Not-null requires/Add not-null ensures context actions should not be available on nullables.

For instance:

if method has return null, if (arg != null), var foo = arg?.boo etc.

Convert property postcondition to object invariant

Property postcondition and statement in ObjectInvariant method are equivalent.
The only difference that in some cases postconditions are hard to use, especially with C# 6.0 features like read-only auto-properties and properties with an expression body.

Refactoring that converts from one implementation to another would be very useful.

Example:

public DateTime TimeStamp? { get; } = DateTime.UtcNow;
public DateTime AnotherTimeStamp => DateTime.Utc.Now;

Preconditions for private methods

Preconditions are for public methods only! in private methods Contract.Assert/Contract.Assume methods should be used.

Benefits: performance benefits by disabling Assert/Assume but leaving Requires.

Fix can warn on this and provide a fix to convert to Contract.Assert/Contract.Assume.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.