pborreli/composer-service

View on GitHub

Showing 31 of 31 total issues

Method __construct has 305 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        /* mandatory requirements follow */

        $installedPhpVersion = PHP_VERSION;
Severity: Major
Found in app/SymfonyRequirements.php - About 1 day to fix

    File SymfonyRequirements.php has 503 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * This file is part of the Symfony package.
     *
    Severity: Major
    Found in app/SymfonyRequirements.php - About 1 day to fix

      File ZeroClipboard.js has 460 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
      * ZeroClipboard
      * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
      * Copyright (c) 2013 Jon Rohan, James M. Greene
      * Licensed MIT

        Function __construct has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct()
            {
                /* mandatory requirements follow */
        
                $installedPhpVersion = PHP_VERSION;
        Severity: Minor
        Found in app/SymfonyRequirements.php - About 5 hrs to fix

        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

        Function create has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function create(button) {
                if (typeof button === "undefined") {
                    console.warn("Ladda button target must be defined.");
                    return;
                }
        Severity: Major
        Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ladda.js - About 2 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              if (options.trustedOrigins) {
                if (typeof options.trustedOrigins === "string") {
                  origins.push(options.trustedOrigins);
                } else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
                  origins = origins.concat(options.trustedOrigins);
          src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ZeroClipboard.js on lines 177..183

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              if (options.trustedDomains) {
                if (typeof options.trustedDomains === "string") {
                  origins.push(options.trustedDomains);
                } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
                  origins = origins.concat(options.trustedDomains);
          src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ZeroClipboard.js on lines 170..176

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function initVML has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function initVML() {
                  function vml(tag, attr) {
                      return createEl("<" + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr);
                  }
                  sheet.addRule(".spin-vml", "behavior:url(#default#VML)");
          Severity: Major
          Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js - About 2 hrs to fix

            Function receiveEvent has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
                eventName = eventName.toString().toLowerCase().replace(/^on/, "");
                var element = currentElement;
                var performCallbackAsync = true;
                switch (eventName) {

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                var _addEventHandler = function(element, method, func) {
                  if (element.addEventListener) {
                    element.addEventListener(method, func, false);
                  } else if (element.attachEvent) {
                    element.attachEvent("on" + method, func);
              src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ZeroClipboard.js on lines 66..72

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 67.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                var _removeEventHandler = function(element, method, func) {
                  if (element.removeEventListener) {
                    element.removeEventListener(method, func, false);
                  } else if (element.detachEvent) {
                    element.detachEvent("on" + method, func);
              src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ZeroClipboard.js on lines 59..65

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 67.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function lines has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      Spinner.prototype.lines = function(el, o) {
                          var r = o.length + o.width, s = 2 * r;
                          function grp() {
                              return css(vml("group", {
                                  coordsize: s + " " + s,
              Severity: Minor
              Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js - About 1 hr to fix

                Function __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
                    {
                        $cfgValue = ini_get($cfgName);
                
                        if (is_callable($evaluation)) {
                Severity: Minor
                Found in app/SymfonyRequirements.php - About 1 hr to fix

                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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                    left: (o.left == "auto" ? tp.x - ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + "px",
                src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js on lines 98..98

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 60.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                    top: (o.top == "auto" ? tp.y - ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + "px"
                src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js on lines 97..97

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 60.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function spin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        spin: function(target) {
                            this.stop();
                            var self = this, o = self.opts, el = self.el = css(createEl(0, {
                                className: o.className
                            }), {
                Severity: Minor
                Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js - About 1 hr to fix

                  Function _getDOMObjectPosition has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var _getDOMObjectPosition = function(obj) {
                      var info = {
                        left: 0,
                        top: 0,
                        width: 0,

                    Function _bridge has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var _bridge = function() {
                        var flashBridge, len;
                        var client = ZeroClipboard.prototype._singleton;
                        var container = document.getElementById("global-zeroclipboard-html-bridge");
                        if (!container) {

                      Function lines has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              lines: function(el, o) {
                                  var i = 0, start = (o.lines - 1) * (1 - o.direction) / 2, seg;
                                  function fill(color, shadow) {
                                      return css(createEl(), {
                                          position: "absolute",
                      Severity: Minor
                      Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/spin.js - About 1 hr to fix

                        Function bind has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function bind(target, options) {
                                options = options || {};
                                var targets = [];
                                if (typeof target === "string") {
                                    targets = toArray(document.querySelectorAll(target));
                        Severity: Minor
                        Found in src/Ayaline/Bundle/ComposerBundle/Resources/public/js/ladda.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language