meteor/meteor

View on GitHub
npm-packages/cordova-plugin-meteor-webapp/src/android/AssetBundleDownloader.java

Summary

Maintainability
B
5 hrs
Test Coverage

Method resume has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void resume() {
        Log.d(LOG_TAG, "Start downloading assets from bundle with version: " + assetBundle.getVersion());

        synchronized (missingAssets) {
            for (final AssetBundle.Asset asset : missingAssets) {

    Method verifyResponse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        protected void verifyResponse(Response response, AssetBundle.Asset asset) throws WebAppException {
            if (!response.isSuccessful()) {
                throw new WebAppException("Non-success status code " + response.code() + " for asset: " + asset);
            }
    
    

    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 verifyRuntimeConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected void verifyRuntimeConfig(JSONObject runtimeConfig) throws WebAppException {
            String expectedVersion = assetBundle.getVersion();
            String actualVersion = runtimeConfig.optString("autoupdateVersionCordova", null);
            if (actualVersion != null) {
                if (!actualVersion.equals(expectedVersion)) {

      Method verifyRuntimeConfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected void verifyRuntimeConfig(JSONObject runtimeConfig) throws WebAppException {
              String expectedVersion = assetBundle.getVersion();
              String actualVersion = runtimeConfig.optString("autoupdateVersionCordova", null);
              if (actualVersion != null) {
                  if (!actualVersion.equals(expectedVersion)) {

      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