partkeepr/PartKeepr

View on GitHub

Showing 481 of 922 total issues

Function parseQuantity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    parseQuantity: function( quantity )
    {
        try {
            quantity = quantity.trim();
            const regex = /[^\d+-.]/g;

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

    initComponent: function ()
    {

        this.infoGrid = Ext.create("PartKeepr.Components.Part.PartInfoGrid", {
            mode: 'short',

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

    onApply: function ()
    {
        var i;

        this.appliedFilters = this.getFilters();

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

    getAppliedPartCount: function (grid) {

        var subParts = grid.parentRecord.subParts();
        var i, total;

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

    onBeforeEdit: function (e, context)
    {
        if (context.field !== "distributor")
        {
            return;

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

    getProjectParts: function (rec) {
        var report = rec.getReport(),
            i,j, project, projectPart, projectPartQuantities = [];

        for (i=0;i<report.reportProjects().getCount();i++) {

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

    initComponent: function () {

        /**
         * @event itemDeselect
         * Fires if a record was deselected within the grid.

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

    public function __invoke(Request $request)
    {
        list($resourceType) = $this->extractAttributes($request);

        $items = $this->dataProvider->getCollection($resourceType);
Severity: Minor
Found in src/PartKeepr/PartBundle/Action/GetPartsAction.php - About 25 mins 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 ensureAuthKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function ensureAuthKey(Request $request)
    {
        $data = json_decode($request->getContent(), true);

        if (!is_array($data) || !array_key_exists('authKey', $data) || !$this->verifyAuthKey($data['authKey'])) {
Severity: Minor
Found in src/PartKeepr/SetupBundle/Controller/SetupBaseController.php - About 25 mins 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 recalculateNormalizedValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function recalculateNormalizedValues()
    {
        if ($this->getSiPrefix() === null) {
            $this->setNormalizedValue($this->getValue());
        } else {
Severity: Minor
Found in src/PartKeepr/PartBundle/Entity/PartParameter.php - About 25 mins 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 getExtJSAssertMappings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getExtJSAssertMappings(ClassMetadata $cm, $field)
    {
        $asserts = [];
        $propertyAnnotations = $this->reader->getPropertyAnnotations($cm->getReflectionProperty($field));

Severity: Minor
Found in src/PartKeepr/DoctrineReflectionBundle/Services/ReflectionService.php - About 25 mins 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 onFlush has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function onFlush(OnFlushEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $uow = $entityManager->getUnitOfWork();

Severity: Minor
Found in src/PartKeepr/PartBundle/Listeners/CategoryPathListener.php - About 25 mins 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 onFlush has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function onFlush(OnFlushEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $uow = $entityManager->getUnitOfWork();

Severity: Minor
Found in src/PartKeepr/FootprintBundle/Listeners/CategoryPathListener.php - About 25 mins 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 initComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    initComponent: function ()
    {
        this.createHintTemplate = Ext.create("Ext.Template", [
            "<code>CREATE USER {user} WITH UNENCRYPTED PASSWORD '{password}'; CREATE DATABASE {dbname}; GRANT ALL PRIVILEGES ON DATABASE {dbname} TO {user};<br/><br/></code>"
        ]);
Severity: Minor
Found in web/setup/js/Cards/DatabaseParametersCard.PostgreSQL.js - About 25 mins 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 renderer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

            renderer: function (val, metaData, record)
            {
                if (record.get("waiting")) {
                    return '<span title="Waiting" style="vertical-align: top;" class="web-icon cog"></span>';
                }
Severity: Minor
Found in web/setup/js/TestResultPanel.js - About 25 mins 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 intTestDBVersionAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function intTestDBVersionAction(Request $request)
    {
        if (!$this->ensureAuthKey($request)) {
            return $this->getAuthKeyErrorResponse();
        }
Severity: Minor
Found in src/PartKeepr/SetupBundle/Controller/SetupController.php - About 25 mins 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 initComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    initComponent: function ()
    {
        this.createHintTemplate = Ext.create("Ext.Template", [
            "CREATE DATABASE {name} CHARACTER SET UTF8;\nGRANT USAGE ON *.* TO {user}@{localhost} IDENTIFIED BY '{password}';\nGRANT ALL PRIVILEGES ON {name}.* TO {user}@{localhost};"
        ]);
Severity: Minor
Found in web/setup/js/Cards/DatabaseParametersCard.MySQL.js - About 25 mins 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 onFlush has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function onFlush(OnFlushEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $uow = $entityManager->getUnitOfWork();

Severity: Minor
Found in src/PartKeepr/StorageLocationBundle/Listeners/CategoryPathListener.php - About 25 mins 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 getRenderParameters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRenderParameters()
    {
        if ($this->getParameter('partkeepr.maintenance') !== false) {
            $renderParams['maintenanceTitle'] = $this->getParameter('partkeepr.maintenance.title');
            $renderParams['maintenanceMessage'] = $this->getParameter('partkeepr.maintenance.message');
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Controller/IndexController.php - About 25 mins 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 exportAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportAction(Request $request)
    {
        $contentTypes = $request->getAcceptableContentTypes();

        $exporter = false;
Severity: Minor
Found in src/PartKeepr/ExportBundle/Controller/ExportController.php - About 25 mins 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

Severity
Category
Status
Source
Language