jumaallan/AndelaCryptoApp

View on GitHub
app/src/main/java/com/androidstudy/andelatrackchallenge/WelcomeActivity.java

Summary

Maintainability
B
4 hrs
Test Coverage

Method updateBackground has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void updateBackground(int position, float positionOffset) {
        @ColorInt
        int background;
        @ColorInt
        int backgroundNext;

    Method updateBackground has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        private void updateBackground(int position, float positionOffset) {
            @ColorInt
            int background;
            @ColorInt
            int backgroundNext;

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method updateTaskDescription has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private void updateTaskDescription(int position) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                String title = getTitle().toString();
                Drawable iconDrawable = getApplicationInfo().loadIcon(getPackageManager());
                Bitmap icon = iconDrawable instanceof BitmapDrawable

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    There are no issues that match your filters.

    Category
    Status