sjwall/MaterialTapTargetPrompt

View on GitHub

Showing 10 of 24 total issues

Method prepare has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public void prepare(@NonNull PromptOptions options,
                        boolean clipToBounds, @NonNull Rect clipBounds)
    {
        mClipToBounds = clipToBounds;
        mClipBounds = clipBounds;

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 dispatchKeyEventPreIme has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public boolean dispatchKeyEventPreIme(KeyEvent event)
        {
            if (mPromptOptions.getBackButtonDismissEnabled()
                    && event.getKeyCode() == KeyEvent.KEYCODE_BACK)

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 create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    @Nullable
    public MaterialTapTargetPrompt create()
    {
        if (!mTargetSet || (mPrimaryText == null && mSecondaryText == null))
        {

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 getTextAlignment has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressLint("RtlHardcoded")
    @NonNull
    public static Layout.Alignment getTextAlignment(@NonNull final Resources resources,
                                                    final int gravity,
                                                    @Nullable final CharSequence text)

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 prepare has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void prepare(@NonNull final PromptOptions options, final boolean clipToBounds,
                        @NonNull final Rect clipBounds)
    {
        // Obtain values from the prompt options.

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 onTouchEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public boolean onTouchEvent(MotionEvent event)
        {
            final float x = event.getX();
            final float y = event.getY();

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 setTypeface has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static void setTypeface(@NonNull TextPaint textPaint, @Nullable Typeface typeface, int style)
    {
        if (style > 0)
        {
            if (typeface == null)

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 isRtlText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean isRtlText(@Nullable final Layout layout, @NonNull final Resources resources)
    {
        boolean result = false;
        if (layout != null)
        {

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 prepare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    void prepare()
    {
        final View targetRenderView = mView.mPromptOptions.getTargetRenderView();
        if (targetRenderView == null)
        {

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 onDraw has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public void onDraw(final Canvas canvas)
        {
            if (mClipToBounds)
            {

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

Severity
Category
Status
Source
Language