MCPcopy Index your code
hub / github.com/Commit451/ParcelCheck

github.com/Commit451/ParcelCheck @1.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.2 ↗ · + Follow
81 symbols 154 edges 22 files 30 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ParcelCheck

Checks models within specified packages to make sure they are properly parcelable Special thanks to @alexkgwyn for creating most of this library.

Build Status

Dependency

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and within your application build.gradle

dependencies {
    androidTestCompile 'com.github.Commit451:ParcelCheck:1.0.1'
}

Usage

Setup is simple, just create a class within your application's androidTest directory and make sure the newly created test extends ParcelCheckPackageTest. To test all models within a package:

public class AllModelsTest extends ParcelCheckPackageTest {

    @Override
    public String[] getModelPackageNames() {
        return new String[] {
                "com.commit451.parcelcheck.sample.models",
                "com.commit451.parcelcheck.sample.otherModels"
        };
    }
}

or alternatively, to test individual models:

public class DogAndPhoneParcelCheckTest extends ParcelCheckTest {

    @Override
    public Class[] getClassesToCheck() {
        return new Class[] {
                Dog.class,
                Phone.class
        };
    }
}

See the sample app for more

Notes

This library does not check the validity of your Parcelable methods. In other words, if you were to flip the value of a boolean when parceling, this library would not catch that. Since most people use generators to generate Parcelable methods, it is more dedicated to catching errors of the user forgetting to regenerate methods after adding data to a model, or other such cases.

License

Copyright 2016 Commit 451

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

OnSomethingCallback (Interface)
Fake interface
app/src/main/java/com/commit451/parcelcheck/sample/packageWithOtherThingsToo/OnSomethingCallback.java

Core symbols most depended-on inside this repo

checkFieldsEqual
called by 5
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java
getObjectForClass
called by 3
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java
getTestObject
called by 3
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java
writeToParcel
called by 2
app/src/main/java/com/commit451/parcelcheck/sample/otherModels/Dog.java
createFromParcel
called by 2
app/src/main/java/com/commit451/parcelcheck/sample/otherModels/Dog.java
getClassFields
called by 2
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java
isParcelable
called by 2
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java
canAdd
called by 1
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectStack.java

Shape

Method 59
Class 21
Interface 1

Languages

Java100%

Modules by API surface

parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectHelper.java13 symbols
app/src/main/java/com/commit451/parcelcheck/sample/otherModels/Dog.java6 symbols
app/src/main/java/com/commit451/parcelcheck/sample/otherModels/Animal.java6 symbols
app/src/main/java/com/commit451/parcelcheck/sample/models/Person.java6 symbols
app/src/main/java/com/commit451/parcelcheck/sample/models/EmptyModel.java6 symbols
app/src/main/java/com/commit451/parcelcheck/sample/brokenModels/Phone.java6 symbols
parcelcheck/src/main/java/com/commit451/parcelcheck/ParcelCheckTest.java4 symbols
parcelcheck/src/main/java/com/commit451/parcelcheck/ParcelCheckPackageTest.java4 symbols
app/src/androidTest/java/com/commit451/parcelcheck/sample/FailureParcelCheckTest.java3 symbols
app/src/androidTest/java/com/commit451/parcelcheck/sample/BrokenParcelPackageTest.java3 symbols
parcelcheck/src/test/java/com/commit451/parcelcheck/ExampleUnitTest.java2 symbols
parcelcheck/src/main/java/com/commit451/parcelcheck/ObjectStack.java2 symbols

For agents

$ claude mcp add ParcelCheck \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact