coding-blocks/DigitalOceanApp

View on GitHub
app/src/main/java/in/tosc/digitaloceanapp/adapters/SelectSizeAdapter.java

Summary

Maintainability
A
1 hr
Test Coverage

Method onBindViewHolder has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void onBindViewHolder(final SelectSizeAdapter.ViewHolder holder, final int position) {

        holder.monthlyPrice.setText(String.format(context.getString(R.string.monthly_price), sizeList.get(position).getPriceMonthly().toString()));
        holder.hourlyPrice.setText(String.format(context.getString(R.string.hourly_price),

    Line is longer than 100 characters (found 134).
    Open

            holder.transfer.setText(String.format(context.getString(R.string.transfer), sizeList.get(position).getTransfer().toString()));

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'java.util.List'
    Open

    import java.util.List;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Parameter name 'v' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
    Open

        public void onClick(View v) {

    Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

    To validate catch parameters please useCatchParameterName.

    To validate lambda parameters please useLambdaParameterName.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'in.tosc.digitaloceanapp.activities.DropletCreateActivity' import. Should be before 'java.util.List'.
    Open

    import in.tosc.digitaloceanapp.activities.DropletCreateActivity;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'in.tosc.digitaloceanapp.R'
    Open

    import in.tosc.digitaloceanapp.R;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'in.tosc.digitaloceanapp.R' import. Should be before 'java.util.List'.
    Open

    import in.tosc.digitaloceanapp.R;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 107).
    Open

            } else if (DropletCreateActivity.getDroplet().getSize().equals(sizeList.get(position).getSlug())) {

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Parameter name 'v' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
    Open

                public void onClick(View v) {

    Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

    To validate catch parameters please useCatchParameterName.

    To validate lambda parameters please useLambdaParameterName.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 113).
    Open

            View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_size, parent, false);

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'in.tosc.doandroidlib.objects.Size' import. Should be before 'java.util.List'.
    Open

    import in.tosc.doandroidlib.objects.Size;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 192).
    Open

            holder.memory.setText(String.format(context.getString(R.string.memory), sizeList.get(position).getMemorySizeInMb().toString(), sizeList.get(position).getVirutalCpuCount().toString()));

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 137).
    Open

            holder.diskSpace.setText(String.format(context.getString(R.string.disk_space), sizeList.get(position).getDiskSize().toString()));

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Each variable declaration must be in its own statement.
    Open

            TextView monthlyPrice, hourlyPrice, memory, diskSpace, transfer;

    Checks that each variable declaration is in its own statement and onits own line.

    Rationale: the Java code conventions chapter 6.1 recommends thatdeclarations should be one per line/statement.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 123).
    Open

    public class SelectSizeAdapter extends RecyclerView.Adapter<SelectSizeAdapter.ViewHolder> implements View.OnClickListener {

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 147).
    Open

            holder.monthlyPrice.setText(String.format(context.getString(R.string.monthly_price), sizeList.get(position).getPriceMonthly().toString()));

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    There are no issues that match your filters.

    Category
    Status