berict/Tapad

View on GitHub
app/src/main/java/com/bedrock/padder/model/tutorial/TutorialXmlParser.java

Summary

Maintainability
A
3 hrs
Test Coverage

Method readItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Sync.Item readItem(XmlPullParser parser) throws IOException, XmlPullParserException {
        Sync.Item item = null;
        parser.require(XmlPullParser.START_TAG, ns, "item");
        String tag = parser.getName();

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

    private Sync readSync(XmlPullParser parser) throws XmlPullParserException, IOException {
        parser.require(XmlPullParser.START_TAG, ns, "sync");
        Log.i(getClass().getSimpleName(), "readSync");
        Sync sync = new Sync();

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

    private Tutorial readTutorial(XmlPullParser parser) throws XmlPullParserException, IOException {
        Tutorial tutorial = new Tutorial(tag, activity);
        Log.i(getClass().getSimpleName(), "readTutorial");

        parser.require(XmlPullParser.START_TAG, ns, "tutorial");

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

    private int readHeadBpm(XmlPullParser parser) throws XmlPullParserException, IOException {
        parser.require(XmlPullParser.START_TAG, ns, "head");
        Log.i(getClass().getSimpleName(), "readHeadBpm");
        int bpm = -1;
        while (parser.next() != XmlPullParser.END_TAG) {

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

    private ArrayList<Sync> readBody(XmlPullParser parser) throws XmlPullParserException, IOException {
        parser.require(XmlPullParser.START_TAG, ns, "body");
        Log.i(getClass().getSimpleName(), "readBody");
        ArrayList<Sync> syncList = new ArrayList<>();
        while (parser.next() != XmlPullParser.END_TAG) {

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